Registration is not deterministic
antspy 0.3.3, the latest as of time writing installed via PyPI
cc #86
https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues
there are other issues here - affine gradient step and other things impact this. anyway, the Mattes metric ( by definition probabilistic ) is the culprit. if you use mean squares or GC ( correlation ) then this goes away. also see the help(ants.registration) which shows *repro option which are the simplified reproducible interfaces that still maintain speed from multi-threading.
I see. I was able to achieve reproducibility by setting ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1.
I think that registration should throw a warning if random_seed is not None but ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS is not set to 1.
The only reason someone would ever set the random seed is because they want reproducible behavior