<br><br><div class="gmail_quote">On Wed, Sep 9, 2009 at 6:17 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Erik,<br><br>The BSplineTransform can be initilized directly with an <br>AffineTransform by simply connecting the AffineTransform <br>as its "Bulk" transform.<br><br>Please look at the examples:<br><br>Insight/Examples/Registration/<br>
DeformableRegistration14.cxx<br> DeformableRegistration15.cxx<br> DeformableRegistration8.cxx<br><br><br>Look for the lines:<br><br> transform->SetBulkTransform( affine_transform );<br><br>
</blockquote><div><br><br>In the DeformableRegistration4.cxx, the BSpline transform creation, intialization, and hook into the registration method looks something like this:<br><br><span style="font-family: courier new,monospace;"> // Create a BSpline transform object.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> typedef itk::BSplineDeformableTransform< </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> CoordinateRepType,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> SpaceDimension, </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> SplineOrder > bsTransformType;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> bsTransformType::Pointer bsTransform = bsTransformType::New();</span><br><br><span style="font-family: courier new,monospace;">// Initialize the BSpline transform parameters.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> typedef bsTransformType::bsParametersType bsParametersType;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> bsParametersType bsParameters( </span><span style="font-family: courier new,monospace;">bsTransform->GetNumberOfParameters()</span><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> bsParameters.Fill( 0.0 );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> bsTransform->SetParameters( bsParameters );</span><br style="font-family: courier new,monospace;">
<br><span style="font-family: courier new,monospace;">// Pass the bsParameters </span><span style="font-family: courier new,monospace;">into the registration method.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> bsRegistration->SetInitialTransformParameters( bsTransform->GetParameters() );</span><br><br><br>Given a prior <span style="font-family: courier new,monospace;">affineTransform</span> that will have a final transform from a completed registration, could the above get replaced with:<br>
<br><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">// Create a BSpline transform object.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> typedef itk::BSplineDeformableTransform< </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> CoordinateRepType,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> SpaceDimension, </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> SplineOrder > bsTransformType;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> bsTransformType::Pointer bsTransform = bsTransformType::New();</span><br>
<br>
<span style="font-family: courier new,monospace;">// Initialize the BSpline transform parameters.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">bsTransform->SetBulkTransform( affineTransform );</span><br style="font-family: courier new,monospace;">
<br>
<span style="font-family: courier new,monospace;">// Pass the bsParameters </span><span style="font-family: courier new,monospace;">into the registration method.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> bsRegistration->SetInitialTransformParameters( bsTransform->GetParameters() );</span><br>
<br><br><br>TIA,<br>Darren<br><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">---<br>
<br>The general problem that you are facing, on the other hand,<br>does not have an easy solution. All Transforms have a <br>different number of parameters. This is simply because the<br>Transform hierarchy is progressively increasing the degrees<br>
of freedom of the transforms.<br><br>You will have to initialize TransformA from TransfromB<br>on a case by case basis.<br><br><br>Regards,<br><br><br> Luis<br><br><br><br>----------------------------------------------------------<div>
<div></div><div class="h5"><br>
<div class="gmail_quote">On Tue, Sep 8, 2009 at 8:11 AM, Erik Tuerke <span dir="ltr"><<a href="mailto:tuerke@cbs.mpg.de" target="_blank">tuerke@cbs.mpg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div><br>
<br>
Hello!<br>
<br>
I am writing a registration programm based on itk.<br>
<br>
I want the program to have the following facility: the user is able to set a series of transforms. Considering an affine transform following a non-linear transform(e.g. bspline transform). What i want to do is to pass only the transform gained by the affine transform to the bspline registration step (not the resampled image from the affine registration step).<br>
My problem is, that the regsitration method of the bspline registration step expects a lot more parameters than i get by the affine registration step. Is there a way to convert the affine transform into a, say, bspline transform and pass this transform to the SetInitialTransformParameters method of the registration method which is responsible for the bspline transform?<br>
<br>
<br>
Thanks a lot and best regards!<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>
</div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>