Mis-aligned labels import

I generated a 3D label map with a segmentation neural network, but I would like to delete some errors using ImFusionLabels.
When I open the original CT and the corresponding segmentation in ImFusionSuite, the alignment of the two volumes is perfect, but if I open them in ImFusionLabels (with “Load” for the CT and “Import” for the label maps) they are no longer aligned.
Do you have any idea how to solve this issue?

Thank you very much!

I am working on mac, and this is probably the reason why the label map appears in stripes in ImFusionLabels, because on a Windows machine the visualisation is correct. Anyway, the error in the alignment appears in both mac and Windows :sweat_smile:

Dear Francesca,

Could you tell us which version of our software you are using, and more importantly share with us (for instance as a private message) an example of a volume and its label map?

Hi Francesca,

I had a look at the data, and it appears that the data has a 180° rotation around the X axis, which the label map does not have. You can see this by right-clicking each dataset in the ImFusion Suite and selecting ‘Edit Transformation’.

In general our handling of label maps requires that the label map has the same dimensions, as well as the same matrix as the corresponding data. You will see that even in the ImFusionSuite, if you try to use our segmentation tools. For example, by selecting both data and label map, and chosing the “Segmentation > Interactive Segmentation”, you will see that the painting is inverted because it does not expect a transformation mismatch (I’m making a mental note to fix this).

In ImFusion Labels we automatically assign the transformation matrix of the data to the labels, so that they match. This is what causes the flipping in your case. A good approach to solving this problem would be to give the choice whether to override the matrix of the label map (the current behavior) or to resample the label map such that the matrices match.

As a more immediate solution, you can either already generate the label map with the same rotation, or post-process it. For example you can do this in the ImFusion Suite like so

  1. Edit the transformation of the label map. Right Click, “Edit Transformation”, set the X rotation to 180°)
  2. Flip the content of the label map. Right click, “Image Processing > Basic Processing”, select “flip” and the axis Y, uncheck “Create new image”.
  3. Repeat step 2. with the axis Z.
  4. Save the new label map and import into Labels.

The label map should now properly match the data and have the same transformation.

It works! Thank you very much! :hugs:

For reference, the versions that I am using are: ImFusion Suite for Academia 2.25.1 and ImFusion Labels 0.13.4 on mac and ImFusion Suite and Labels 2.25.1 on windows.