|
15 | 15 | import itk
|
16 | 16 | import numpy as np
|
17 | 17 | import ipywidgets as widgets
|
18 |
| -from traitlets import CBool, CFloat, Unicode, CaselessStrEnum, List, validate |
| 18 | +from traitlets import CBool, CFloat, CInt, Unicode, CaselessStrEnum, List, validate |
19 | 19 | from ipydatawidgets import NDArray, array_serialization, shape_constraints
|
20 |
| -from .trait_types import ITKImage, PointSetList, PolyDataList, itkimage_serialization, polydata_list_serialization, Colormap |
| 20 | +from .trait_types import ITKImage, ImagePointTrait, ImagePoint, PointSetList, PolyDataList, itkimage_serialization, image_point_serialization, polydata_list_serialization, Colormap |
21 | 21 |
|
22 | 22 | try:
|
23 | 23 | import ipywebrtc
|
@@ -170,6 +170,12 @@ class Viewer(ViewerParent):
|
170 | 170 | default_value=None,
|
171 | 171 | allow_none=True,
|
172 | 172 | help="World-space position of the Z slicing plane.").tag(sync=True)
|
| 173 | + clicked_slice_point = ImagePointTrait( |
| 174 | + default_value=None, |
| 175 | + allow_none=True, |
| 176 | + help="Data for the point clicked on an image slice.").tag( |
| 177 | + sync=True, |
| 178 | + **image_point_serialization) |
173 | 179 | gradient_opacity = CFloat(
|
174 | 180 | default_value=0.2,
|
175 | 181 | help="Volume rendering gradient opacity, from (0.0, 1.0]").tag(sync=True)
|
@@ -306,6 +312,9 @@ def __init__(self, **kwargs): # noqa: C901
|
306 | 312 | opacities_array = self._validate_geometry_opacities(proposal)
|
307 | 313 | kwargs['geometry_opacities'] = opacities_array
|
308 | 314 | self.observe(self._on_geometries_changed, ['geometries'])
|
| 315 | + if 'label_map' in kwargs: |
| 316 | + # Interpolation is not currently supported with label maps |
| 317 | + kwargs['interpolation'] = False |
309 | 318 |
|
310 | 319 | super(Viewer, self).__init__(**kwargs)
|
311 | 320 |
|
@@ -733,6 +742,7 @@ def view(image=None, # noqa: C901
|
733 | 742 |
|
734 | 743 | interpolation: bool, optional, default: True
|
735 | 744 | Linear as opposed to nearest neighbor interpolation for image slices.
|
| 745 | + Note: Interpolation is not currently supported with label maps. |
736 | 746 |
|
737 | 747 | gradient_opacity: float, optional, default: 0.22
|
738 | 748 | Gradient opacity for composite volume rendering, in the range (0.0, 1.0].
|
|
0 commit comments