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

Beginnings of a default set up for reproducible registration in antsx #1189

Open
stnava opened this issue May 10, 2021 · 7 comments
Open

Beginnings of a default set up for reproducible registration in antsx #1189

stnava opened this issue May 10, 2021 · 7 comments
Labels
enhancement Enhancements under development - feel free to join discussion if you'd like to contribute help needed Issues that require feedback or expertise from the community. Discussion and PRs welcome

Comments

@stnava
Copy link
Member

stnava commented May 10, 2021

goal

Provide a generally agreed upon and easily accessible set of registration parameters that support reproducible results with multi-threading

proposed solution

  1. set random seed to 1 (though still allow user to control this)
  2. Use GC metric for translation/rigid/affine
  3. 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 as MI

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.

@ntustison
Copy link
Member

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.

@stnava
Copy link
Member Author

stnava commented May 11, 2021

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.

@ntustison
Copy link
Member

Okay, I'll put that on my to-do list to get to quickly. Will let you know when I finish.

@ntustison
Copy link
Member

ANTsX/ANTsRCore#132

and

#1190

@stnava
Copy link
Member Author

stnava commented May 12, 2021

nice - I also added rank_intensity/rankIntensity to antspy/R .... remains to be seen how useful they are.

@cookpa
Copy link
Member

cookpa commented May 17, 2021

Updated the wiki to mention the new script options

https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues

@cookpa
Copy link
Member

cookpa commented Jun 14, 2021

@cookpa cookpa added enhancement Enhancements under development - feel free to join discussion if you'd like to contribute help needed Issues that require feedback or expertise from the community. Discussion and PRs welcome labels Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements under development - feel free to join discussion if you'd like to contribute help needed Issues that require feedback or expertise from the community. Discussion and PRs welcome
Projects
None yet
Development

No branches or pull requests

3 participants