Hello<br><br>I am trying to register two 2D images with some offset and rotation.<br><br>Section 8.7.1 of the Software Guide shows how to change parameters for the Optimizer in between iterations of the multi resolution registration framework. It also mentions that you could even swap out components between levels. This is where I'm having trouble.
<br><br>I'd like the first resolution registration to perform the Translation transform, and the second to do an Affine transform. The idea here is to use a Gradient Descent optimizer for each, and the MeanSquaresImageToImageMetric for both as well. Later I should be able to switch these components in between resolutions as well. I was planning on trying Mattes MI with a OnePlusOne for the first stage.
<br><br>Is there some pattern I need to follow in my Command Observer class to switch components? I have gone ahead and set the registration's transform to the new object using SetTransform(). I created a new Optimizer and set the parameters accordingly. I tried then calling Update() on the registration.
<br><br>When the program gets to the second resolution, I get the error message "The size of Scales is 6, but the NumberOfParameters for the CostFunction is 2." coming out of the RegularStepGradientDescentOptimizer. The first level had only 2 parameters as the transform was a translation, and the second had 6 for affine.
<br><br>Is there an example somewhere which actually does switch components in between resolutions, or does anyone know what I'm doing / not doing?<br><br>Thanks in advance!<br><br>Dan<br>