ANTs
ANTs copied to clipboard
Beginnings of a default set up for reproducible registration in antsx
goal
Provide a generally agreed upon and easily accessible set of registration parameters that support reproducible results with multi-threading
proposed solution
- set random seed to 1 (though still allow user to control this)
- Use GC metric for translation/rigid/affine
- Use CC metric for deformable ( radius 2 for quick settings )
example implementation
See ANTsPy example (somewhat tested): here
issues
-
We don’t know how well this setup will perform for “in the wild” data
-
GC
is not as general asMI
note
This function can help to some extent with the limitations of correlation metrics:
def rank_intensity( x, method='max' ):
fim = ants.get_mask( x )
fir = rankdata( (x*fim).numpy(), method=method )
fir = fir - 1
fir = fir.reshape( fi.shape )
rimg = ants.from_numpy( fir.astype(float) )
rimg = ants.iMath(rimg,"Normalize")
return( ants.copy_image_info( x, rimg ) )
It transforms intensities to reduce impact of outlier intensities or the effects of “unusual” histogram shapes.
For T1, the transformed image still looks “good” … not sure about other modalities.
what would need to be done
- standardize parameters if the ones I've proposed are not agreeable
- propagate the same approach to .sh scripts and
ANTsR
- verify results are reproducible across runs and n-threads for each implementation
- potentially implement a specific version for MI as well where multi-modal registration is concerned
- alternatively, implement a reproducible variant of the MI metric --- doable by truncating precision but this may be a fragile solution and some other approach (unknown) may be better
any thoughts appreciated.
Yeah, I'm guessing the ANTsPy antsRegistrationSyNQuickRepro
option is a good option. I agree that it should be propagated to ANTsR and the .sh scripts. We can even do that before we agree upon parameters. Is anybody else working on that? If not, I can add it to my to-do list and get to it pretty quickly.
my preliminary relatively large scale (2000 images) testing looks ok for these parameters .... will look more soon but perhaps it would be worth putting a beta version into ANTsR, at least, if not ANTs.
Okay, I'll put that on my to-do list to get to quickly. Will let you know when I finish.
https://github.com/ANTsX/ANTsRCore/pull/132
and
https://github.com/ANTsX/ANTs/pull/1190
nice - I also added rank_intensity/rankIntensity to antspy/R .... remains to be seen how useful they are.
Updated the wiki to mention the new script options
https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues
Linking to Discourse thread
https://discourse.itk.org/t/multi-threads-registration-reproducibility/4030/13