@@ -215,12 +215,12 @@ class Viewer(ViewerParent):
215
215
help = "Region of interest: [[lower_x, lower_y, lower_z), (upper_x, upper_y, upper_z]]" )\
216
216
.tag (sync = True , ** array_serialization )\
217
217
.valid (shape_constraints (2 , 3 ))
218
- vmin = CFloat (
218
+ vmin = List ( trait = CFloat (),
219
219
default_value = None ,
220
220
allow_none = True ,
221
221
help = "Value that maps to the minimum of image colormap." ).tag (
222
222
sync = True )
223
- vmax = CFloat (
223
+ vmax = List ( trait = CFloat (),
224
224
default_value = None ,
225
225
allow_none = True ,
226
226
help = "Value that maps to the maximum of image colormap." ).tag (
@@ -345,6 +345,14 @@ def __init__(self, **kwargs): # noqa: C901
345
345
proposal = {'value' : kwargs ['cmap' ]}
346
346
cmap_list = self ._validate_cmap (proposal )
347
347
kwargs ['cmap' ] = cmap_list
348
+ if 'vmin' in kwargs and kwargs ['vmin' ] is not None :
349
+ proposal = {'value' : kwargs ['vmin' ]}
350
+ vmin_list = self ._validate_vmin (proposal )
351
+ kwargs ['vmin' ] = vmin_list
352
+ if 'vmax' in kwargs and kwargs ['vmax' ] is not None :
353
+ proposal = {'value' : kwargs ['vmax' ]}
354
+ vmax_list = self ._validate_vmax (proposal )
355
+ kwargs ['vmax' ] = vmax_list
348
356
self .observe (self ._on_geometries_changed , ['geometries' ])
349
357
have_label_map = 'label_map' in kwargs and kwargs ['label_map' ] is not None
350
358
if have_label_map :
@@ -587,6 +595,26 @@ def _validate_cmap(self, proposal):
587
595
else :
588
596
return [value ]
589
597
598
+ @validate ('vmin' )
599
+ def _validate_vmin (self , proposal ):
600
+ value = proposal ['value' ]
601
+ if value is None :
602
+ return None
603
+ elif isinstance (value , list ):
604
+ return value
605
+ else :
606
+ return [value ]
607
+
608
+ @validate ('vmax' )
609
+ def _validate_vmax (self , proposal ):
610
+ value = proposal ['value' ]
611
+ if value is None :
612
+ return None
613
+ elif isinstance (value , list ):
614
+ return value
615
+ else :
616
+ return [value ]
617
+
590
618
@validate ('point_set_colors' )
591
619
def _validate_point_set_colors (self , proposal ):
592
620
value = proposal ['value' ]
@@ -807,13 +835,13 @@ def view(image=None, # noqa: C901
807
835
label_map_blend : float, default: 0.5
808
836
Label map blend with intensity image, from 0.0 to 1.0.
809
837
810
- vmin: float , default: None
811
- Value that maps to the minimum of image colormap. Defaults to minimum of
812
- the image pixel buffer .
838
+ vmin: list of floats , default: Minimum of the image pixel buffer
839
+ Value that maps to the minimum of image colormap. A single value
840
+ can be provided or a list for multi-component images .
813
841
814
- vmax: float , default: None
815
- Value that maps to the minimum of image colormap. Defaults to maximum of
816
- the image pixel buffer .
842
+ vmax: list of floats , default: Maximum of the image pixel buffer
843
+ Value that maps to the minimum of image colormap. A single value can
844
+ be provided or a list for multi-component images .
817
845
818
846
cmap: list of strings
819
847
default:
0 commit comments