How to build/specify optimizer and metric objects for imregister function

I'd like to use the imregister function with metric and/or optimizer objects other than those specified in documentation that I have been able to find. Specifically, I'd like to use a correlation ratio as the similarity measure as opposed to Mutual Information or Mean Square Error. How might I be able to set this up using existing matlab functions/objects or making my own in matlab?

 Risposta accettata

5 Commenti

Thanks for the response. I had already taken a look at that link beforehand but was hoping there would be some existing accommodation for user specified metric/optimizer objects in imregister so I could take advantage of what I'm assuming is image pyramid reduction levels as well as the perturbation provided by the optimizer OnePlusOneEvolutionary setting (not much documentation so I'm guessing here). Setting this up with fminsearch() as you've suggested, sounds a bit more involved. That being said, if I'm using a tform object as a parameter (from the example in the link), would that be counted as one paramter or nine (since its actually 3 by 3 matrix)? The reason I ask is the comment mentioned about fminsearch() not converging well with parameters above 6.
I had already taken a look at that link beforehand but was hoping there would be some existing accommodation for user specified metric/optimizer objects in imregister
I agree that would be nice, but sadly, no, imregister is not set up to be an image registration toolbox :-(
if I'm using a tform object as a parameter (from the example in the link), would that be counted as one paramter or nine (since its actually 3 by 3 matrix)?
You would choose your parameters based on the number of degrees of freedom in your family of deformations. So, if you are doing rigid registration, you would have 6 parameters: 3 translation variables and 3 rotation angles. You would build the tform as a function of those.
You would choose your parameters based on the number of degrees of freedom in your family of deformations. So, if you are doing rigid registration, you would have 6 parameters: 3 translation variables and 3 rotation angles. You would build the tform as a function of those.
Yup you're totally right, thanks. One last question: If I'm going to do something with more degrees of freedom (say a 3D affine transform -- 12 DOF, or possibly a LOT more i.e. nonlinear), how would you recommend I go about it with the Optimization toolbox? Could you give me an example possibly or does something else come to mind?
fmincon() should be able to handle pretty much any twice-differentiable similarity measure. Understanding how to use it to do the minimization won't be the hard part. It works pretty much the same as fminsearch in terms of input syntax.
>>doc fmincon
will bring you to examples. The hard part will be the coding of the objective function and its derivatives if you decide to do that.
An important difference between fmincon and fminsearch is that fmincon requires (twice) differentiability. So, you have to apply imtransform/tformarray with the 'bicubic' interpolation option. This is more intensive computationally than the default linear interpolation, so things will be slower. Also, if you do not supply a function that computes your cost function derivatives, fmincon will approximate them by finite differences by default, which will be additionally expensive. Supplying a function of your own that computes the gradient analytically is an option, but requires non-trivial programming effort.
Thanks very much for the info. I'll give it a shot.

Accedi per commentare.

Più risposte (0)

Prodotti

Richiesto:

il 6 Nov 2013

Commentato:

il 11 Nov 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by