spinalcordtoolbox / PAM50

https://github.com/neuropoly/spinalcordtoolbox
2 stars 1 forks source link

Update `PAM50_cord.nii.gz` spinal cord segmentation #21

Closed jcohenadad closed 11 months ago

jcohenadad commented 1 year ago

This PR introduces an updated version of the PAM50_cord.nii.gz spinal cord segmentation and other related template files. This PR is required for https://github.com/spinalcordtoolbox/PAM50/pull/18.

Fixes #17, Fixes #19, Fixes #20

Scripts were created to do the modifications. I am uploading them on this repository as they might be useful in the future.

Modification of PAM50_cord.nii.gz

The cord segmentation was only modified on the right side (faster, less error-prone), and then R-L symmetrization was ran:

python symmetrize_cord_segmentation.py

Modification of PAM50_levels.nii.gz

After modifying the cord segmentation, the labeled segmentation had to be udpated:

python label_segmentation.py

Results (old vs. new):

anim

Modification of PAM50_wm.nii.gz and PAM50_gm.nii.gz

Will be done in a subsequent PR: https://github.com/spinalcordtoolbox/PAM50/issues/23

joshuacwnewton commented 11 months ago

A couple of points I notice:

jcohenadad commented 11 months ago

The PR description mentions modifying wm/gm as a follow-up. But, do we also need to update PAM50_levels_continuous.nii.gz, PAM50_csf.nii.gz, and PAM50_centerline.nii.gz? I notice that these files are also missing some of the new slices that were added to the level file.

Excellent point-- see #25

jcohenadad commented 11 months ago

There are some discrepancies between the old cord/levels files and the new cord/levels files. For example, at level 11, the old level file (white) has some extra voxels compared to the new level file (green):

That's fine-- the old was not perfectly symmetrized (I guess), so that was an issue (now fixed)

jcohenadad commented 11 months ago

Another example is the boundary between the levels 19 and 20:

that's ok

jcohenadad commented 11 months ago

Given that the changes in this PR are mainly focused on the C1/caudal areas, are these changes expected?

not expected, but better to improve where things could be improved

jcohenadad commented 11 months ago

How did you determine where to stop with the caudal segmentation? To my (very untrained) eyes, with the PAM50_t2.nii.gz as a background image, it seems like there may be more cord below where the segmentation stops. (I presume I'm naively missing something here, though?)

Great question-- thank you for asking. When looking at the T1w, we notice that the cord is stopping at around L1/L2 disc. See this screen recording, with slices going caudally. When reaching L1/L2 disc, we notice that the spinal cord is becoming very small, and the only tissue remaining are the nerve projecting on/from the sacral part of the spinal cord. Given that these nerves have a relatively short T2, when packed together, they appear as a 'dark mass' on T2w contrast, so it seems like cord tissue is still present below L1/L2, while in fact these are only nerves.

https://github.com/spinalcordtoolbox/PAM50/assets/2482071/f1ad93a8-c2b0-41c3-a8e4-b30d993e971e

This is also suggested by the Frostell et al., where the cord is said to stop at around L1/L2. Although this needs to be taken with a grain of salt, given that we know there is inter-subject variability (notably wrt. size, age, etc.).

jcohenadad commented 11 months ago

that being said, from your screenshot, I notice that the cord seems undersegmented in the AP direction. Looking at the T1w image further confirms this. So I will likely add more cord tissue in the AP direction.

image

EDIT: After scrutinizing a bit more the current cord mask, I don't see anything obvious in terms of improvement. I suggest to go ahead with this version, if need be, we can improve it in the future based on users feedback.

jcohenadad commented 11 months ago

I notice that the cord file still extends above where the new C1 level stops. Is this small region something we want to include in the levels file? Or is it excluded intentionally, since it's above the C1 level?

Also good point. I don't see any harm in keeping segmentation above C1, even though it would not be considered 'spinal cord' tissue anymore, but rather medulla oblongata. I can imagine some users in the future trying to do stuff in this region, and needing this tissue. Who knows... in any case, I see more pros than cons in keeping that. Good point though.