File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,8 @@ def create_closed_surface_from_labelmap(
274274 surface_mesh ,
275275 )
276276
277+ # Some scalars can get tacked on by the above processing for some reason, so remove those in case they are present
278+ surface_mesh .GetPointData ().SetScalars (None )
277279 return surface_mesh
278280
279281def spherical_interpolator_from_mesh (
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ def test_create_closed_surface_from_labelmap():
107107 point_distance_from_sphere_center = np .linalg .norm (point_position - sphere_center , ord = 2 )
108108 assert np .abs (point_distance_from_sphere_center - sphere_radius ) < 1.
109109
110+ # verify that there are no scalars on the point data since these are undesirable in slicer, and the function
111+ # isn't supposed to add a colormap or anything like that
112+ assert surface .GetPointData ().GetScalars () is None
113+
110114def test_spherical_interpolator_from_mesh ():
111115 """Check using a torus that the spherical interpolator behaves reasonably"""
112116 parametric_torus = vtk .vtkParametricTorus ()
You can’t perform that action at this time.
0 commit comments