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

antsMultivariateTemplateConstruction2.sh repeats N4 on every iteration #1590

Closed
gdevenyi opened this issue Aug 22, 2023 · 9 comments · Fixed by #1591
Closed

antsMultivariateTemplateConstruction2.sh repeats N4 on every iteration #1590

gdevenyi opened this issue Aug 22, 2023 · 9 comments · Fixed by #1591

Comments

@gdevenyi
Copy link
Contributor

The location of the N4 code for template construction:
https://github.com/ANTsX/ANTs/blob/master/Scripts/antsMultivariateTemplateConstruction2.sh#L1490-L1492

Results in N4 being re-run on the input files for every iteration of the template construction. Computational time could be saved if it were moved to a step beforehand, or if a file check were added to see if the N4 processed files already exist.

@ntustison
Copy link
Member

Thanks @gdevenyi . Do you want to put together a pull request or should I put it on my to-do list?

@gdevenyi
Copy link
Contributor Author

If you agree this is worth addressing, I can do a PR.

Shall I check the other model scripts as well?

@ntustison
Copy link
Member

Sure, as to the PR. But what model scripts are you referring to?

@gdevenyi
Copy link
Contributor Author

Btp and antsMultivariateTemplateConstruction.sh

@ntustison
Copy link
Member

Okay, sure.

@cookpa
Copy link
Member

cookpa commented Aug 28, 2023

Thanks for this @ntustison and @gdevenyi

Should we also remove the default -b [ 200 ]? It will cause problems for non-human images.

@gdevenyi
Copy link
Contributor Author

Should we also remove the default -b [ 200 ]? It will cause problems for non-human images.

I agree that's an issue, but I'm not sure what the default would do without that. In general the tools I write which wrap around ANTs, I usually calculate the largest physical scale of the image and start with that as the N4 distance.

@ntustison
Copy link
Member

IMO, ideally we would remove N4 entirely from the template building scripts and simply leave it to the user to do any preprocessing. Outside of that, I agree with @gdevenyi in calculating it on the fly.

@cookpa
Copy link
Member

cookpa commented Aug 28, 2023

OK I will leave it for now, and think more about how to prepare images in general.

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

Successfully merging a pull request may close this issue.

3 participants