I am segmenting prostates with Slicer and now I want to post-process my segmentations. So I read the nrrd segmentation files with my python code. I have a case where I have one file with one segmentation and two segments corresponding to two lesions. I notice that:
in the nrrd file the data is 4-d array where the first dimension seems to correspond to the segment in a multi-segment segmentation. (is that the case?)
The header dimension header is now 4 (instead of 3) I am assuming that is because each segment/lesion is stored in its own array.
The spaces direction header is an array with 4 elements now, whereas the first element of the array is ‘none’ and the other three elements are 3-d vectors. I assume this is to match the fact that data is now a 4-d matrix (is that the case?)
The sizes header is also 4-d and it seems that the first coordinate corresponds to the number of segments and the other three are the minimum common cube that contain the segments.
Are my assumptions correct?