Sct_process_segmentation is mixing up diameter_RL and diameter_AP

I’m running sct_process_segmentation on my ex-vivo rat spinal cord scans that look like this:

Looking at the images, diameter_RL should be roughly twice as long than diameter_AP on average.
The segmentation with sct_propseg looks fine it covers the whole spinal cord.

However for some reason in about 50% of the scans, in the csa.csv file the diameter values are mixed up, i.e. the diameter_AP column consists of all the values that are roughly twice of diameter_RL.

Is there something wrong with the orientation of those scans? I had to manually fix the labels to get AP and RL correct and it worked like this with the other sct functions.

hum… it could be a few things, like wrong estimation of ellipse axis or anisotropic in-plane voxel. I could try to debug it if you send me an example image with the associated segmentation.

cheers,
Julien

Hi Julien,

If you can have a look at the attached file that would be great:
segment_example.zip (2.0 MB)

It is true that the voxels are very unisotropic, unfortunately: 0.1 mm on the R-L axis and 0.05 mm on A-P

Apart from the wrong axis I think the diameter estimates are correct though. I could sort them by just forcing the column with larger values to be R-L, but it seems to also affect the calculated values of eccentricity and solidity which I can’t fix.

Hi @Felix,

I was able to identify the bug and find a fix for it. More info here.

In the meantime (i.e. before the PR is merge and we release a patch 4.0.1), you can obtain proper measurement by resampling your dataset:

sct_resample -i t2_seg.nii.gz -mm 0.05x0.85x0.05 -o t2_segr.nii.gz
sct_process_segmentation -i t2_segr.nii.gz 

Thank you very much for reporting this issue!

Cheers,
Julien

1 Like

Hi Felix,

The issue has now been fixed in 4.0.1, which you can download here:

Cheers,
Julien