View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012026ITKITKpublic2011-03-30 04:462011-04-22 15:46
ReporterThiago R. dos Santos 
Assigned Tokentwilliams 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0012026: itk::LandmarkBasedTransformInitializer does not work with a float transform as template parameter
Descriptionitk::LandmarkBasedTransformInitializer is templated over a transform type TTransform, which itself is templated over the scalartype.

itk::LandmarkBasedTransformInitializer works only with two specific transform types. They are defined like that:
  /** Supported Transform typedefs */
  typedef VersorRigid3DTransform< ParameterValueType >
VersorRigid3DTransformType;
  typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;


looking deep into the inheritance hierarchy, I found that ParameterValueType ultimately is hardcoded to float. In my opinion, ParameterValueType is just the wrong type here. It should use ''TransformType::ScalarType' instead, because that is the actual scalar type template parameter of the template transform.

It is the same bug reported in: http://www.itk.org/Bug/view.php?id=9421 [^]
Steps To Reproduce typedef itk::Image< signed short, 3> ImageType;
  typedef itk::VersorRigid3DTransform< float > ITKVersorTransformType;
  typedef itk::LandmarkBasedTransformInitializer<
ITKVersorTransformType, ImageType, ImageType > TransformInitializerType;
  ITKVersorTransformType::Pointer transform = ITKVersorTransformType::New();
  TransformInitializerType::Pointer init = TransformInitializerType::New();
  init->SetTransform(transform);
  ...
  init->InitializeTransform();

Everything compiles fine. But when I execute the code, the following warning appears:
WARNING: In
v:\windows\source\itk3120\code\common\itkLandmarkBasedTransformInitializ
er.txx, line 413
LandmarkBasedTransformInitializer (0000000004156C10): Landmark initialization using the specified input transform not implemented

WARNING: In
v:\windows\source\itk3120\code\common\itkLandmarkBasedTransformInitializ
er.txx, line 418
LandmarkBasedTransformInitializer (0000000004156C10): Landmark initialization using the specified input transform not implemented


If ITKVersorTransformType is changed like this:
  typedef itk::VersorRigid3DTransform< double > ITKVersorTransformType;
everything is working.
Additional InformationThere are two relevant typedefs for the problem:

  typedef typename TransformType::ParametersType ParametersType;
  typedef typename ParametersType::ValueType ParameterValueType;

If you follow the typedef chain of ParameterValueType, eventually the class itk::TransformBase will be reached. If you take a look to ParameterValueType, you will see that it is hard coded to double.

If you modify the typedef in itk::LandmarkBasedTransformInitializer to this:

typedef typename TransformType::ScalarType ParameterValueType;

everything works fine!!
TagsNo tags attached.
Resolution Date2011-04-21
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0026243)
kentwilliams (developer)
2011-04-22 15:46

This is fixed in ITKV4

 Issue History
Date Modified Username Field Change
2011-03-30 04:46 Thiago R. dos Santos New Issue
2011-04-01 10:10 Hans Johnson Assigned To => kentwilliams
2011-04-01 10:10 Hans Johnson Status new => assigned
2011-04-22 15:46 kentwilliams Resolution Date => 2011-04-21
2011-04-22 15:46 kentwilliams Note Added: 0026243
2011-04-22 15:46 kentwilliams Status assigned => closed
2011-04-22 15:46 kentwilliams Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team