@@ -43,9 +43,16 @@ class ImageWidget(ipyw.VBox):
43
43
44
44
image_width, image_height : int
45
45
Dimension of Jupyter notebook's image widget.
46
+
47
+ image_widget : obj or None
48
+ Jupyter notebook's image widget. If None, a new widget will be created.
49
+
50
+ cursor_widget : obj or None
51
+ Jupyter notebook's cursor widget. If None, a new widget will be created.
46
52
"""
47
53
48
54
def __init__ (self , logger = None , image_width = 500 , image_height = 500 ,
55
+ image_widget = None , cursor_widget = None ,
49
56
** kwargs ):
50
57
super ().__init__ ()
51
58
if 'use_opencv' in kwargs :
@@ -54,7 +61,7 @@ def __init__(self, logger=None, image_width=500, image_height=500,
54
61
DeprecationWarning )
55
62
56
63
self ._viewer = EnhancedCanvasView (logger = logger )
57
- self .ALLOWED_CURSOR_LOCATIONS = ['top' , 'bottom' , None ]
64
+ self .ALLOWED_CURSOR_LOCATIONS = ['top' , 'bottom' , None ]
58
65
self .RESERVED_MARKER_SET_NAMES = ['all' ]
59
66
60
67
if image_widget is None :
@@ -108,8 +115,6 @@ def __init__(self, logger=None, image_width=500, image_height=500,
108
115
self ._cursor = 'bottom'
109
116
self .children = [self ._jup_img , self ._jup_coord ]
110
117
111
-
112
-
113
118
# These need to also be set for now.
114
119
# Ginga uses them to figure out what size image to make.
115
120
self ._jup_img .width = image_width
0 commit comments