<br>Hi Neuhaus,<br><br><br><self rant><br><br>This illustrates once again the Nefarious consequences of<br>using dynamic_casting inside ITK classes to try to discover<br>the type of the template parameters....<br><br>
Just FYI: the LandmarkBasedTransformInitializer uses the<br>sub-optimal approach of using dynamic_casts and a sequence<br>of switch/case statements for selecting different implementations.<br><br>Every use of dynamic_casting is a symptom of bad design when<br>
using Generic Programming.<br><br></self rant><br><br><br>In your case, the difficulty arises from the fact that the template<br>parameter of your VersorRigid3DTransform is probably "float"<br>while the one used in the LandmarkBasedTransformInitializer<br>
is probably "double".<br><br>You may want to try declaring your transform as:<br><br>typedef itk::VersorRigid3DTransform< double >
ITKVersorTransformType;<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"></blockquote><br><br>Also, could you please file a bug report about this issue in the bug tracker ?<br>
<a href="http://public.kitware.com/Bug/my_view_page.php">http://public.kitware.com/Bug/my_view_page.php</a><br><br>In that way we can address this issue in ITK 4.0.<br><br><br> Thanks<br><br><br> Luis<br><br>
<br>------------------------------------------------------------------------------------<br><div class="gmail_quote">On Thu, Aug 13, 2009 at 10:43 AM, Neuhaus Jochen <span dir="ltr"><<a href="mailto:j.neuhaus@dkfz-heidelberg.de">j.neuhaus@dkfz-heidelberg.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;">Hi List,<br>
<br>
I try to initialize a transform using<br>
itk::LandmarkBasedTransformInitializer the following way:<br>
<br>
typedef itk::Image< signed short, 3> ImageType;<br>
typedef itk::VersorRigid3DTransform< MyPointType::ValueType ><br>
ITKVersorTransformType;<br>
typedef itk::LandmarkBasedTransformInitializer<<br>
ITKVersorTransformType, ImageType, ImageType > TransformInitializerType;<br>
ITKVersorTransformType::Pointer transform =<br>
ITKVersorTransformType::New();<br>
TransformInitializerType::Pointer init =<br>
TransformInitializerType::New();<br>
init->SetTransform(transform);<br>
...<br>
init->InitializeTransform();<br>
<br>
Everything compiles fine. But when I execute the code, the following<br>
warning appears:<br>
WARNING: In<br>
v:\windows\source\itk3120\code\common\itkLandmarkBasedTransformInitializ<br>
er.txx, line 413<br>
LandmarkBasedTransformInitializer (0000000004156C10): Landmark<br>
initialization using the specified input transform not implemented<br>
<br>
WARNING: In<br>
v:\windows\source\itk3120\code\common\itkLandmarkBasedTransformInitializ<br>
er.txx, line 418<br>
LandmarkBasedTransformInitializer (0000000004156C10): Landmark<br>
initialization using the specified input transform not implemented<br>
<br>
<br>
I traced the problem to the following issue:<br>
<br>
My MyPointType::ValueType is float. If I change it to double, everything<br>
works fine.<br>
<br>
Itk:: LandmarkBasedTransformInitializer defines the supported transforms<br>
like this:<br>
/** Supported Transform typedefs */<br>
typedef VersorRigid3DTransform< ParameterValueType ><br>
<br>
VersorRigid3DTransformType;<br>
typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;<br>
<br>
<br>
looking deep into the inheritance hierarchy, I found that<br>
ParameterValueType ultimately is hardcoded to float. In my opinion,<br>
ParameterValueType is just the wrong type here. It should use<br>
'ScalarType' instead, because that is the actual template parameter.<br>
<br>
Has anybody encountered this problem? Is there a better way to achieve<br>
this? Should I just submit a bug report to ITK?<br>
<br>
<br>
Thanks,<br>
Jochen<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>
</blockquote></div><br>