Yes, it appears to use some typedefs such as OffsetType specific to itk::MatrixOffsetTransformBase. Sadly, itk::TranslationTransform etc aren&#39;t derived from itk::MatrixOffsetTransformBase.<br><br>Try to add the line <br>
<br>  typedef OutputVectorType OffsetType; <br><br>to itk::TranslationTransform and see if it works for you. If so, please send us the patch.<br><br>thanks<br><br><div class="gmail_quote">On Mon, Nov 9, 2009 at 1:23 PM, Lodron, Gerald <span dir="ltr">&lt;<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>&gt;</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;"><br>
I am not sure if i understand this CenteredTransformInitializer class, can anyone explain me why itk::CenteredTransformInitializer does work for itk::AffineTransform but not for itk::TranslationTransform or itk::ScaleTransform?<br>

<br>
Maybe it is a bug?<br>
<div class="im"><br>
Best regards!<br>
<br>
<br>
<br>
<br>
<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: Luis Ibanez [mailto:<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>]<br>
Gesendet: Montag, 09. November 2009 01:25<br>
An: Lodron, Gerald<br>
Cc: Insight users (<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>)<br>
Betreff: Re: [Insight-users] Problem with CenteredTransformInitializer<br>
<br>
</div><div><div></div><div class="h5">Hi Gerald,<br>
<br>
Please post to the mailing list the compilation error that<br>
you get with this code.<br>
<br>
It will make a lot easier for us to advise you if we can<br>
see the error message.<br>
<br>
<br>
Also,<br>
please note that the following construction is incorrect:<br>
<br>
   RegistrationType * m_Registration = RegistrationType::New();<br>
<br>
It should be:<br>
<br>
   RegistrationType::Pointer  m_Registration = RegistrationType::New();<br>
<br>
<br>
<br>
along the same lines, the statement:<br>
<br>
TransformType* m_Transformation =<br>
     itk::AffineTransform&lt;double, VImageDimension&gt;::New();<br>
<br>
should be<br>
<br>
TransformType::Pointer m_Transformation =<br>
     itk::AffineTransform&lt;double, VImageDimension&gt;::New();<br>
<br>
<br>
If you don&#39;t assign a newly created ITK object to a SmartPointer,<br>
the object will be destroyed by the next line in the code.<br>
<br>
If you are getting run-time errors, this misuse of the New() method<br>
may explain what is happening with your program at run-time.<br>
Introducing a proper use of SmartPointers may fix the problem.<br>
<br>
---<br>
<br>
For more information about the use of SmartPointers in ITK, please<br>
read the introductory chapters of the ITK Software Guide:<br>
<br>
          <a href="http://www.itk.org/ItkSoftwareGuide.pdf" target="_blank">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>
<br>
and the Tutorials:<br>
<br>
           <a href="http://www.itk.org/ITK/help/tutorials.html" target="_blank">http://www.itk.org/ITK/help/tutorials.html</a><br>
<br>
in particular:<br>
<a href="http://www.itk.org/CourseWare/Training/GettingStarted-I.pdf" target="_blank">http://www.itk.org/CourseWare/Training/GettingStarted-I.pdf</a><br>
<br>
<br>
<br>
<br>
    Regards,<br>
<br>
<br>
           Luis<br>
<br>
<br>
-----------------------------------------------------------<br>
On Fri, Nov 6, 2009 at 6:09 AM, Lodron, Gerald<br>
&lt;<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>&gt; wrote:<br>
&gt;<br>
&gt; Hello<br>
&gt;<br>
&gt; I try to make a rigid 3 d registration of two singed short images, i always get a compiler error when i want to use the CenteredTransformInitializer, here is my code<br>
&gt;<br>
&gt;<br>
&gt; template &lt;class TPixelSource=signed short,class TPixelTarget=signed short, unsigned int VImageDimension=3&gt;<br>
&gt;<br>
&gt;        typedef itk::Image&lt; TPixelTarget, VImageDimension &gt;                     TargetImageType;<br>
&gt;        typedef itk::Image&lt; TPixelSource, VImageDimension &gt;                     SourceImageType;<br>
&gt;        typedef float                                                                   InternalPixelType;<br>
&gt;        typedef itk::Image&lt; InternalPixelType, VImageDimension &gt;                InternalImageType;<br>
&gt;<br>
&gt;        typedef itk::MultiResolutionImageRegistrationMethod&lt;InternalImageType, InternalImageType &gt;              RegistrationType;<br>
&gt;        typedef typename RegistrationType::TransformType                        TransformType;<br>
&gt;        typedef itk::CenteredTransformInitializer&lt;TransformType, TargetImageType, SourceImageType &gt;             InitializerType;<br>
&gt;<br>
&gt;        RegistrationType*       m_Registration = RegistrationType::New();<br>
&gt;<br>
&gt;        TransformType* m_Transformation = itk::AffineTransform&lt;double, VImageDimension&gt;::New();<br>
&gt;<br>
&gt;        m_Registration-&gt;SetTransform(m_Transformation);<br>
&gt;<br>
&gt;        InitializerType* m_InitTransform = InitializerType::New();<br>
&gt;        m_InitTransform-&gt;SetTransform(   m_Transformation ); //exception<br>
&gt;<br>
&gt;<br>
&gt; Would be great if anyone could give me a hint,<br>
&gt;<br>
&gt; Best regards<br>
&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<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><br>_________________________________<br>Karthik Krishnan<br>R&amp;D Engineer,<br>Kitware Inc.<br>Ph: +1 5188814919, +91 9538477060<br>