Skip to content

Commit b5ca585

Browse files
committed
fix empty masks in isosurface when smoothed too much
1 parent c0c6028 commit b5ca585

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

matRad/plotting/matRad_computeAllVoiSurfaces.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@
5555

5656
%Smooth the VOI
5757
v = smooth3(mask,'gaussian',[5 5 5],2);
58-
isoSurface = isosurface(xMesh,yMesh,zMesh,v,0.5);
58+
59+
maskThreshold = 0.5;
60+
61+
%Small sanity check in case we smoothed to much on a small VOI
62+
if all(v(:) < maskThreshold)
63+
v = mask;
64+
end
65+
66+
isoSurface = isosurface(xMesh,yMesh,zMesh,v,maskThreshold);
67+
5968

6069
%reduce the complexity
6170
isoSurface = reducepatch(isoSurface,0.05);

0 commit comments

Comments
 (0)