CoBrALab / optimized_antsMultivariateTemplateConstruction

A re-implementation of antsMultivariateTemplateConstruction2.sh using optimized image pyramid scale-space and qbatch support
Other
20 stars 8 forks source link

Add a backwards option to (twolevel_)commonspace_resample.sh #96

Closed jeremie-fouquet closed 1 month ago

jeremie-fouquet commented 9 months ago

Add the possibility of transforming volumes from the common space to the individual spaces. It can be useful, for instance, to propagate a mask from the common space to all the individual spaces.

jeremie-fouquet commented 9 months ago

After reviewing the code, it looks like quite a few of the options in (twolevel_)commonspace_resample.sh are named based on an individual -> common space direction (e.g., prepend-transforms, append-transforms, target-space).

I think it might be simpler to create two new functions, for instance with names (twolevel_)reverse_commonspace_resample.sh, instead of trying to accommodate the two directions in a single instance of the functions.

@gdevenyi , what do you think?

gdevenyi commented 9 months ago

I think target-space subject or input is a good choice here, and careful re-wording of prepend-transforms and append-transforms to indicate where they go in the the stack rather than describing a direction per-se solves the problem.

jeremie-fouquet commented 8 months ago

In the end, I found it difficult to implement the options I wanted for the "reverse" direction (commonspace -> subjectspace) without importantly modifying several parts of (twolevel_)commonspace_resample.sh. Hence, as a first try, I created two new functions: subjectspace_resample.sh and twolevel_subjectspace_resample.sh.

I hope it helps to lay out the code needed. I'm happy to work on merging the two directions if required.

Also, I only tested the new functions on our MPM twolevel data set. Are there other tests I should perform?

gdevenyi commented 8 months ago

Please open a PR to discuss the code :+1: