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.&nbsp; It also mentions that you could even swap out components between levels.&nbsp; 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.&nbsp; The idea here is to use a Gradient Descent optimizer for each, and the MeanSquaresImageToImageMetric for both as well.&nbsp;&nbsp; Later I should be able to switch these components in between resolutions as well.&nbsp; 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?&nbsp; I have gone ahead and set the registration's transform to the new object using SetTransform().&nbsp; I created a new Optimizer and set the parameters accordingly.&nbsp; I tried then calling Update() on the registration.
<br><br>When the program gets to the second resolution, I get the error message &quot;The size of Scales is 6, but the NumberOfParameters for the CostFunction is 2.&quot; coming out of the RegularStepGradientDescentOptimizer.&nbsp; 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>