Radiologist saved segmentations without references -> annotations come out cropped when loading as numpy arrays

Dear forum,

My dear radiologists saved all the segmentations they created without a reference as compressed niftis. Therefore, all the annotations appear cropped if I load them as numpy arrays using nibabel.

My image data is 240x240x192; however, when loading the images they appear with varying sizes cropped around the actual annotations.

How can I load numpy arrays from the with the proper dimensions of the reference image and in the correct location?

Probably, the necessary information is saved somewhere in the header because I can still open the images with slicer and they show up correctly.

Thanks for your help!

You can write a script in Slicer to export the segmentations with respect to a reference geometry, e.g. like this.

1 Like