How to export data from Slicer to LifeX?

Hello,
I need to export brain ROIs from Slicer and then use them in LifeX. However, something goes wrong and LifeX doesn’t display the ROIs, on top of flashing the “Inconsistent ROI size” warning.
Both images (patient head + ROIs) have the same size: 176x256x256, so that’s not where the issue comes from.

So far I have been trying to:

  • import the ROI file as a binary label map (+ the corresponding table),
  • convert it to segmentation mode so I can delete the ROIs I don’t need, then back to binary map,
  • export it to files as Nifti.
    I have tried also to make sure the MRI patient image is set as the reference geometry for the structure set in Segmentations module (as per that post: Issue with mask exported from Slicer - #6 by lassoan) but it didn’t help.

So, does anyone know how to export suitable data for LifeX from Slicer?

Thanks in advance.
Best regards,
A. Jacob

In case someone else runs into the same issue later on: Slicer doesn’t take into account the image rotation (common for neurological scans), while LifeX does. The error therefore stems from the fact the base image is rotated while the segmentation isn’t.

To fix it, you need to uncheck the box in LIFEx : Settings/Series/IOP. (IOP should be “false”)

I’m glad you got this to work, and thanks for reporting back to help future users :+1:

Of course Slicer does take into account the orientation of the image acquisition, so the underlying issue is probably different assumptions in LifeX about what the nifti file means. If you are interested to look further you could use the Volume Information panel in the Volumes module of Slicer to look at the orientations of the dicom and nifti data to confirm that they are rotated according to the acquisition and line up in Slicer. If ignoring the ImageOrientationPatient makes it work in LifeX that’s okay, but in general it can be important not to lose that information since you may want to overlay other images that are in the same FrameOfReference but acquired at different orientations (or spacings, fields of view, etc).

Sorry but I don’t think folks here have experience with or access to LifeX.

According to Slicer (in the Volume Information panel), the base image and the exported segmentation file have the same dimensions and orientation. I guess LifeX must read the header info differently…