sct-pipeline / spine-park

Pipeline for multicontrast analysis in PD patients
MIT License
0 stars 0 forks source link

Possible issue with registration? #47

Closed jcohenadad closed 4 months ago

jcohenadad commented 4 months ago

While working on https://github.com/sct-pipeline/spine-park/issues/45, I noticed a poor quality registration, which reminded me of the SCT issue solved at https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4533:

ezgif-4-1b9d55d85e

However, the code that produced that registration, even though it was not the latest master branch, was a commit that supposedly already had the fix to the registration issue (https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4533/commits/517cc66596db50a310ddc0bdf8985fbbe54405a4)

I consider this a "red flag" so I'm further investigating it. Hopefully it won't open another can of worms...

jcohenadad commented 4 months ago

I obtain the same poor quality result from my laptop, running a more recent version, that definitely includes the fix (https://github.com/spinalcordtoolbox/spinalcordtoolbox/commit/9e1f65b86902cb237d5f79058a4623eed2d2c8eb)

jcohenadad commented 4 months ago

Re-running in debug mode. Label-based registration works fine:

image

jcohenadad commented 4 months ago

ahah! same symptom as in https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4533: even thought the label-based registration was apparently successful, the affine transformation did not bring the the straight spinal cord aligned with the PAM50 centerline:

seg_bin_rpi_1mm_crop_straightAffine_crop.nii.gz:

image
jcohenadad commented 4 months ago

ahah! the problem is not with SCT but with the spine-park code and that particular subject, that is missing the T5 level, because we create a label at T5 for the registration here:

https://github.com/sct-pipeline/spine-park/blob/84ba26feb1c2094e956cc43d808bd857d156d934/batch_processing.sh#L144

that label is not created, yielding a registration with only a single label. So we can close, and we need to fix the issue for that subject specifically at https://github.com/sct-pipeline/spine-park/issues/45