Using Paint or Smoothing tool spoils the segment

I recently ran with a problem in Slicer when I try to use Paint to edit a segment and segment immediately spoils on the first contact with the study. Pixels become huge, contours are rough, neighboring structures are layered with each other, and on 3D reconstructions, everything looks as if I did not use smoothing, but built a reconstruction in Minecraft.
Smoothing has the same problem when using a sphere brush in Median mode. Instead of smoothing the area of interest, it immediately makes the entire segment untidy and crooked.
Sometimes the problem with the segment can only be seen when you rerun a saved study.
Sometimes it helps to delete the segmentation and create a new one with the old segment.

What could be the reason for this Slicer’s behavior? Maybe the problem is in the segments or segmentations themselves and how can I find out it?

Everything works as intended. Your segmentation used closed surface or ribbon representation (e.g., because you loaded the segmentation from a model or a DICOM RT structure set). When you performed an editing operation, the source representation is atuomatically switched to binary labelmap, which is indeed “blocky” (it is made up of discrete voxels). See more information here.

If you find that the binary labelmap representation is not sufficiently detailed then you can change the segmentation’s geometry as described here.

Thanks, Andras
I understand that blocks may appear during editing, but not sure that this size of “blocks” are fine. I had such a problem for the first time.
On the other hand, I noticed that the size of some segmentations is different from the size of the original studies. Maybe the Slicer itself is trying to fit the segment to the basic CT size?
BUT! For example, I run a few segmentations that differ in size from the original CT. Why most of them do not have such a problem, and some begin to have such a blocky appearance?

image image

Yes. The default voxel size of the binary labelmap representation is set to be the same as the source volume that is selected when the segmentation is created. You can change the geometry as described in the Segment Editor documentation section that I linked above.

But then why Slicer doesn’t try to adapt all the segments to suit the original size? The part works fine. So, for example, I have a CT with a size of 626x626x626 and 4 segments with a size of 333x333x333, but one of them will have structures with blocky pixels, and the other 3 are ideal :man_shrugging:
Sorry to bother you with these questions, but I’m curious to know how it works.

To minimize the number of labelmap resampling operations (resampling is a lossy operation), resampling is only done when it is needed - for example when the segmentation is edited or written to file. Until then each segment keeps its own geometry, which may be different from the other segments (for example if the segment was copied from another segmentation). If you create a new segment then the reference geometry of the segmentation is used, which comes from the geometry of the source volume that was selected first when the segmentation was created.

This default behavior does not require any input from users and it does what users expect most of the time. If this is not ideal for your use case then you can set the segmentation geometry explicitly as described at the link above.

1 Like