Hello,<br><br>I wanted to make a registration that translates a 3D image in x,y,z and rotates the image in the in plane (typically x,y) but not z when the through plane slice spacing is large to prevent banding and artefacts in the image due to rotating over the lab slice gap. So that's 5 degrees of freedom rotation in x,y and translation in x,y,z.<br>
<br>I used a VersorRigid3DTransform which is 6 degrees of freedom.<br><br>typedef typename itk::VersorRigid3DTransform< double > TransformType;<br>typedef typename itk::VersorRigid3DTransformOptimizer OptimizerType;<br clear="all">
<br><br>And register and calculate a transformation matrix and offset <br>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">0.99587 -0.0714092 0.056069</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">0.0731405 0.996887 -0.0294547</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">-0.0537911 0.033434 0.997992</span></p><p style="margin:0px;text-indent:0px"><style type="text/css">p, li { white-space: p</style><br>
</p><p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">Offset [-13.0234, 1.55239, 11.5985]</span></p><p></p><br>Then I reset the through plane/Z rotation component to its part of the Identity matrix. <br>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">0.99587 -0.0714092 0.056069</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">0.0731405 0.996887 -0.0294547</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">0 0 1</span></p><p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">And apply this transformation. <br>
</span></p><p style="margin:0px;text-indent:0px"><br><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)"></span></p><p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">This strategy isn't optimal because I found the optimal transformation with the through plane/Z rotation and then eliminated the rotation. It's better to never rotate in through plane/Z during the registration/transformation optimization process. <br>
</span></p><p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">I tried changing the scales of the optimizer. I believe the [2] index is for the Z component. <br></p><p style="margin:0px;text-indent:0px">
I tried changing [2] to 0, -1, 0.000001, -0.000001. 0 crashes and the other values change the registration output but don't turn of Z rotation. <br></p><p style="margin:0px;text-indent:0px"><br><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)"></span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(26,26,26)">typedef OptimizerType::ScalesType OptimizerScalesType;<br> OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() );<br>
const double translationScale = 1.0 / 1000.0;<br><br><br> optimizerScales[0] = 1.0;<br> optimizerScales[1] = 1.0;<br> optimizerScales[2] = 1.0; // ? Z component<br> optimizerScales[3] = translationScale;<br> optimizerScales[4] = translationScale;<br>
optimizerScales[5] = translationScale;<br><br> optimizer->SetScales( optimizerScales );<br></span></p><br><br>Is there some way to turn off rotation in a single (usually Z) axis?<br><br>Cheers,<br>Karl <br><br>-- <br>
<font color="#888888">Karl Diedrich, Ph.D.<br>Principal Engineer<br>----------------------------------------<br>
AZE Research and Development<br>1 Broadway, 14th floor<br>Cambridge, MA 02142<br>Tel: <a value="+16174751502">+1 (617) 475-1502</a><a value="+19492288509"></a><br><a href="http://www.azeofamerica.com/" target="_blank">www.azeofamerica.com</a></font><br>