<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=770475307-10112009>Oh I think my C++ vodoo is not good enough to fix that
bug, i am only a poor user. Changes in the ITK code should really be made
from someone which is knowing what he does, I would make more worse than better
i think. I am currently in the learning phase and does not really know what
90 % of the code really does!</SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> Karthik Krishnan
[mailto:karthik.krishnan@kitware.com] <BR><B>Gesendet:</B> Dienstag, 10.
November 2009 08:44<BR><B>An:</B> Lodron, Gerald<BR><B>Cc:</B> Luis Ibanez;
Insight users (insight-users@itk.org)<BR><B>Betreff:</B> Re: [Insight-users]
Problem with CenteredTransformInitializer<BR></FONT><BR></DIV>
<DIV></DIV>Yes, it appears to use some typedefs such as OffsetType specific to
itk::MatrixOffsetTransformBase. Sadly, itk::TranslationTransform etc aren'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><<A
href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><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<double, VImageDimension>::New();<BR><BR>should
be<BR><BR>TransformType::Pointer m_Transformation =<BR>
itk::AffineTransform<double, VImageDimension>::New();<BR><BR><BR>If you
don'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><<A
href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</A>>
wrote:<BR>><BR>> Hello<BR>><BR>> 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>><BR>><BR>> template <class TPixelSource=signed
short,class TPixelTarget=signed short, unsigned int
VImageDimension=3><BR>><BR>> typedef
itk::Image< TPixelTarget, VImageDimension >
TargetImageType;<BR>>
typedef itk::Image< TPixelSource, VImageDimension >
SourceImageType;<BR>> typedef float
InternalPixelType;<BR>> typedef itk::Image<
InternalPixelType, VImageDimension >
InternalImageType;<BR>><BR>>
typedef
itk::MultiResolutionImageRegistrationMethod<InternalImageType,
InternalImageType >
RegistrationType;<BR>> typedef typename
RegistrationType::TransformType
TransformType;<BR>>
typedef itk::CenteredTransformInitializer<TransformType,
TargetImageType, SourceImageType >
InitializerType;<BR>><BR>>
RegistrationType* m_Registration =
RegistrationType::New();<BR>><BR>>
TransformType* m_Transformation = itk::AffineTransform<double,
VImageDimension>::New();<BR>><BR>>
m_Registration->SetTransform(m_Transformation);<BR>><BR>>
InitializerType* m_InitTransform =
InitializerType::New();<BR>>
m_InitTransform->SetTransform( m_Transformation );
//exception<BR>><BR>><BR>> Would be great if anyone could give me a
hint,<BR>><BR>> Best regards<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>><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&D Engineer,<BR>Kitware Inc.<BR>Ph: +1 5188814919, +91
9538477060<BR></BODY></HTML>