Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cropped edges in registration to the template #33

Closed
jcohenadad opened this issue May 14, 2024 · 15 comments
Closed

Cropped edges in registration to the template #33

jcohenadad opened this issue May 14, 2024 · 15 comments

Comments

@jcohenadad
Copy link
Member

When working on #31 I noticed cropped edges in the registered template:

ezgif-3-c9f1467a0f

I suspect this is caused by improper straightening (too large curvature?). I'll investigate

@jcohenadad
Copy link
Member Author

jcohenadad commented May 14, 2024

The segmentation goes to the last bottom slice:
image

And the straightening looks OK:
image

The NURBS-based fitting looks OK:
fig_centerline_240514-085522686883_nurbs

@jcohenadad
Copy link
Member Author

jcohenadad commented May 14, 2024

The straight2curve warping field applied to the straightened image does not result in the same original image (notice the discs move a lot, and the cord seems slightly larger on the registered image):

ezgif-3-56e1998e68

Although I don't think this explains the multiple slices that are missing on the edges, this is highly concerning and an issue should be opened on SCT

EDIT 20240514_094659: Issue opened: spinalcordtoolbox/spinalcordtoolbox#4477

@jcohenadad
Copy link
Member Author

@Kaonashi22 now that spinalcordtoolbox/spinalcordtoolbox#4477 is solved, I'm rerunning processing on 14 subjects to see if this issue is resolved on your data. I'll report results here.

@Kaonashi22
Copy link

Thanks @jcohenadad!

@jcohenadad
Copy link
Member Author

OK, in general, the fix improves results a lot. However, some issues still remain, that I'm investigating now. For example, with subject sub-DEV169Sujet03, the fix still produced cropped edges.

Before fix:
ezgif-7-2aa1afd53a

After fix:
ezgif-7-58c0bfa6e5

@jcohenadad
Copy link
Member Author

Comparing the input image and the input-straight-curved shows highly similar content overall (thanks to spinalcordtoolbox/spinalcordtoolbox#4514), except at the top/bottom edge:

ezgif-7-3b1fbed23d

Maybe this is the cause of the problem?

It is surprising, given that many slices are affected at the bottom (about 30), even though the warping field at the bottom seems only affected over a few slices, and the segmentation is fine towards the bottom:

image

@jcohenadad
Copy link
Member Author

The first landmark-based rigid registration did not work:
getRigidTransformFromLandmarks_plot

Leading to a strong cropping of the straightened image:
image

@jcohenadad
Copy link
Member Author

Going into debug mode...

The input label files to step=0 are properly positioned and oriented:

image

@jcohenadad
Copy link
Member Author

jcohenadad commented Jun 11, 2024

Checking on another subject where this cropping is not/less apparent: sub-BB277

Ah! Still not working properly:
image

@jcohenadad
Copy link
Member Author

jcohenadad commented Jun 11, 2024

Has this issue been introduced by spinalcordtoolbox/spinalcordtoolbox#4514? Let's re-run SCT before the fix...

nope! Same problem before the fix:
image

@jcohenadad
Copy link
Member Author

@Kaonashi22 good news, the issue has been identified and fixed in spinalcordtoolbox/spinalcordtoolbox#4533. Once @joshuacwnewton reviews it we will merge it and you can resume your experiments.

@Kaonashi22
Copy link

Thanks everyone!!!

@jcohenadad
Copy link
Member Author

jcohenadad commented Jun 18, 2024

@Kaonashi22 to be 100% sure I'm also re-running the processing on the 14 subjects you shared with me. I'll share the QC report once done.

EDIT 20240618_142034:

Two crashes:

@joshuacwnewton
Copy link
Member

Sorry for the delay! The PR has been merged. Feel free to update your local copies of SCT and retry.

@jcohenadad
Copy link
Member Author

jcohenadad commented Jun 19, 2024

@Kaonashi22 you need to do the following:

cd $SCT_DIR
git pull

And then you can re-run the processing on all subjects. For every new issue you experience, please open a specific issue. I'm closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants