diff --git a/itkwidgets/_initialization_params.py b/itkwidgets/_initialization_params.py index 28cf9795..ae9e224c 100644 --- a/itkwidgets/_initialization_params.py +++ b/itkwidgets/_initialization_params.py @@ -15,6 +15,8 @@ def init_params_dict(itk_viewer): 'blend_mode': itk_viewer.setImageBlendMode, 'cmap': itk_viewer.setImageColorMap, 'color_range': itk_viewer.setImageColorRange, + 'vmin': itk_viewer.setImageColorRangeMin, + 'vmax': itk_viewer.setImageColorRangeMax, 'color_bounds': itk_viewer.setImageColorRangeBounds, 'component_visible': itk_viewer.setImageComponentVisibility, 'gradient_opacity': itk_viewer.setImageGradientOpacity, diff --git a/itkwidgets/viewer.py b/itkwidgets/viewer.py index 4b999daf..be584714 100644 --- a/itkwidgets/viewer.py +++ b/itkwidgets/viewer.py @@ -335,6 +335,27 @@ def set_image_color_range(self, range: List[float]): async def get_image_color_range(self): return await self.viewer_rpc.itk_viewer.getImageColorRange() + @property + @fetch_value + async def vmin(self): + range = await self.get_image_color_range() + return range[0] + @vmin.setter + @fetch_value + async def vmin(self, vmin: float): + self.queue_request('setImageColorRangeMin', vmin) + + @property + @fetch_value + async def vmax(self): + range = await self.get_image_color_range() + return range[1] + @vmax.setter + @fetch_value + async def vmax(self, vmax: float): + self.queue_request('setImageColorRangeMax', vmax) + + @fetch_value def set_image_color_range_bounds(self, range: List[float]): self.queue_request('setImageColorRangeBounds', range) @@ -744,6 +765,12 @@ def view(data=None, **kwargs): :param color_range: The [min, max] range of the data values mapped to colors for the given image component identified by name. :type color_range: list, default: The [min, max] range of the data values + :param vmin: Data values below vmin take the bottom color of the color map. + :type vmin: float + + :param vmax: Data values above vmax take the top color of the color map. + :type vmax: float + :param color_bounds: The [min, max] range of the data values for color maps that provide a bounds for user inputs. :type color_bounds: list, default: The [min, max] range of the data values diff --git a/itkwidgets/viewer_config.py b/itkwidgets/viewer_config.py index a80b7593..d34ef416 100644 --- a/itkwidgets/viewer_config.py +++ b/itkwidgets/viewer_config.py @@ -1,5 +1,5 @@ ITK_VIEWER_SRC = ( - "https://bafybeiaceucriosbgkyrnknz3f6je6diihyldqwrxx7l5dkrc5hqgg3kum.on.fleek.co/" + "https://bafybeigczshobl7lpiyj26r6mr2zsibwoiq7ueqmqdfmynqbznvxmfiddq.on.fleek.co/" ) PYDATA_SPHINX_HREF = "https://cdn.jsdelivr.net/npm/itk-viewer-bootstrap-ui@0.29.0/dist/bootstrapUIMachineOptions.js.es.js" MUI_HREF = "https://cdn.jsdelivr.net/npm/itk-viewer-material-ui@0.3.0/dist/materialUIMachineOptions.js.es.js"