Is it possible to write a registration framework that would work for any image pair? Meaning, the same inputs and framework would work on image pairs of different specimens?
Or is the ITK registration framework too sensitive for general registration, and the inputs will always be situation dependent??
Unfortunately, there is no universal registration algorithm.
In ITK/SimpleITK, registration is formulated as non-linear optimization which depends on the type of transformation (rigid, affine, BSpline etc.), the similarity function (mutual information is the most general but not always the most appropriate) and the optimization algorithm (there isn’t one that is optimal for all optimized functions, a.k.a “no free lunch theorem”).
Registration is still an active research area with the soup of the day being deep learning (still optimization but much higher dimensional).
If I wanted to write a certain type of affine only registration that would work universally, is that possible??
I am looking at just writing a general framework that will be able to correlate subregions of any type of image. If I wanted to just stick to only using an Affine Transform for this would that be possible?
That is a bit more specific and possibly doable. If the only thing you can say about all the pairs of images that you want to register is that there is a statistical relationship between them, then you can use mutual information and it should work.
If you know more about the images, say they have a linear (we usually call it linear but mathematically it is affine) relationship, using correlation is faster because of simpler calculation and often more stable because we are explicitly imposing a constraint.
Just call the ImageRegistrationMethod’s SetMetricAsCorrelation. The rest of the registration code can remain pretty much whatever you have right now (assuming you are using SetMetricAsMattesMutualInformation right now).
I am currently trying to write a type of image correlation code that will be added to a software. I need this type of code to work for any image that the user inputs. Right now, I am mainly focused on just getting 2D image data to work, then will move to 3D.
Would you suggest that I code different registration options for the user to select? ie. Translation, Affine, Euler, etc. Or do you think that it is possible to write a code that would work for any image input using just affine transform with correlation metric?
SimpleElastix is available as part of SimpleITK, but not as part of a binary distribution, for additional details see the discussion on this GitHub issue.