Skip to content

Commit 680a8c3

Browse files
committed
ENH: Add support for itk.PointSet
1 parent 8a389df commit 680a8c3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

itkwidgets/integrations/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ def _get_viewer_point_sets(point_sets):
146146
return xarray_data_array_to_numpy(point_sets)
147147
if isinstance(point_sets, xr.Dataset):
148148
return xarray_data_set_to_numpy(point_sets)
149+
if HAVE_ITK:
150+
import itk
151+
if isinstance(point_sets, itk.PointSet):
152+
return itk.array_from_vector_container(point_sets.GetPoints())
149153
return point_sets
150154

151155

@@ -173,6 +177,9 @@ def _detect_render_type(data, input_type) -> RenderType:
173177
import itk
174178
if isinstance(data, itk.Image):
175179
return RenderType.IMAGE
180+
elif isinstance(data, itk.PointSet):
181+
print(f'isinstance(data, itk.PointSet)', flush=True)
182+
return RenderType.POINT_SET
176183
if HAVE_MULTISCALE_SPATIAL_IMAGE:
177184
from multiscale_spatial_image import MultiscaleSpatialImage
178185
if isinstance(data, MultiscaleSpatialImage):

0 commit comments

Comments
 (0)