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

Ants Longitudinal CT Template-Build Stage fail #1634

Closed
dbrennan44 opened this issue Dec 12, 2023 · 12 comments · Fixed by #1635
Closed

Ants Longitudinal CT Template-Build Stage fail #1634

dbrennan44 opened this issue Dec 12, 2023 · 12 comments · Fixed by #1635
Labels
bug Reproducible bugs

Comments

@dbrennan44
Copy link

dbrennan44 commented Dec 12, 2023

Hi all,

ANTs Longitudinal Cortical Thickness is failing at the template-building stage with 2 scans. Oddly, this behavior does not happen each time antsCT is run (rerunning a subject can work). Here is an example output with error message:

output is attached for formatting
output.txt

I can provide the two images if it helps diagnose.

Thank you!

@cookpa
Copy link
Member

cookpa commented Dec 12, 2023

What's your ANTs version?

@dbrennan44
Copy link
Author

ANTs Version: v2.4.1.post7-g71c9890

from antsRegistration

@cookpa
Copy link
Member

cookpa commented Dec 12, 2023

Might be data-dependent. I think this arises from scales estimation in the beginnings of registration

https://discourse.itk.org/t/zero-valued-spacing-is-not-supported-and-may-result-in-undefined-behavior/5382/6
#1348

Will try to reproduce with data

@dbrennan44
Copy link
Author

here is a link

I will note, I manually truncated the images before processing because the FOV was very large and included the neck.

@cookpa
Copy link
Member

cookpa commented Dec 12, 2023

Thanks, the images look like they should work. This works for me on Mac OS using 2.5.0.post12-g9516f51 (I ran it twice)

antsMultivariateTemplateConstruction.sh -d 3 -o template -b 0 -g 0.25 -i 4 -c 2 -j 4 -k 1 -w 1 -m 100x70x30x3 -n 1 -r 1 -s CC -t GR -y 1 -z scan_a.nii.gz scan_a.nii.gz scan_b.nii.gz

@dbrennan44
Copy link
Author

great! My problem was happening within a call to antsLongitudinalCorticalThickness.sh. Can the templates be built outside of this script and used? Perhaps an initial template?

@cookpa
Copy link
Member

cookpa commented Dec 13, 2023

Right, I used the template command from your original output.txt, which doesn't include the original call to the longitudinal script. Unfortunately it's not easy to use an initial template with that script.

We might debug further if you can try running the longitudinal script with -b 1 to keep temporary files. When it fails, does it leave behind a template T_template0.nii.gz? If the template is blank for some reason, the next iteration may fail with the error message you saw.

Also if you can add the original call to antsLongitudinalCorticalThickness.sh I'll try to reproduce the whole script call.

@dbrennan44
Copy link
Author

heres the Template folder

there are a lot of intermediate templates

@cookpa
Copy link
Member

cookpa commented Dec 13, 2023

Thanks! The template failed and is blank, which creates the error. Possibly related, I see that your input file names are identical - this will cause problems.

This is definitely something we should check for and fix at run time. Meanwhile, you might try changing the input files to MPRAGE_baseline.nii.gz and MPRAGE_followup.nii.gz

@cookpa cookpa added the bug Reproducible bugs label Dec 13, 2023
@dbrennan44
Copy link
Author

I will try this and report, good to know! Previous successful runs with different data had different file names!

@dbrennan44
Copy link
Author

I ran two subjects after changing the image basenames, and both ran thru antsLongitudinalCorticalThickness successfully. Think this was the problem, especially because a control cohort (1 scan each) ran fully successfully with no issue. Thank you!

@cookpa
Copy link
Member

cookpa commented Dec 14, 2023

Great, thanks for sharing the info to help track this down! I think it is a simple fix to make the template scripts name their output uniquely. The longitudinal script already does this, so it should be fixed now.

@cookpa cookpa closed this as completed Dec 14, 2023
@cookpa cookpa linked a pull request Dec 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants