What is the best way to iterate through DICOM image data with RTSTRUCT contours in a loadable module?

Dear developers,

I have CT DICOM files and RTSTRUCT file which contains contours of the organs.
SlicerRT module loads series and segmentation without errors, and i want to check
what segment each pixel belongs to. This is similar to the information of the
“Data Probe” module, but i wanted to store such information for each pixel as a
std::bitset (each bit represents contour)
and use it further in an external Monte-Carlo package.

For that purpose i create vtkMRMLLabelMapVolumeNode for visible segments
and check if pixel of vtkMRMLScalarVolumeNode belongs to the labelmap
segment or not. Labelmaps for some segments contain “artefacts”,
while displayable nodes look good.

May be there is another way to get such information for each pixel?

Best regards,
Mikhail

There are artifacts in rendering of slice intersections when representation is closed surface due to this bug in VTK.

Usually we show binary labelmap representation in slice views. You can create binary labelmap representation by going to Segmentations module / Representation section and clicking “Create” button next to “Binary labelmap”.

You can export segments to a labelmap node in Segmentations module’s Export/import section (or by right-clicking on the segmentation node in Data module).