[Insight-developers] Recent changes to Transforms break ITK's API

Bill Lorensen bill.lorensen at gmail.com
Sun Jul 14 11:31:33 EDT 2013


Folks,

When I compile the following code I get this compilation error:

/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Remote/WikiExamples/IO/TransformFileWriter.cxx:
In function ‘int main(int, char**)’:
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Remote/WikiExamples/IO/TransformFileWriter.cxx:20:
error: no matching function for call to
‘itk::TransformFileWriterTemplate<double>::SetInput(itk::SmartPointer<itk::Rigid2DTransform<float>
>&)’
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx:78:
note: candidates are: void
itk::TransformFileWriterTemplate<ScalarType>::SetInput(const
itk::TransformBaseTemplate<TScalarType>*) [with ScalarType = double]

---------------------------------------------------------------------------------------------------
#include "itkRigid2DTransform.h"
#include "itkTransformFileWriter.h"

int main(int argc, char *argv[])
{
  std::string fileName;
  if(argc == 1) // No arguments were provided
  {
    fileName = "test.tfm";
  }
  else
  {
    fileName = argv[1];
  }

  typedef itk::Rigid2DTransform< float > TransformType;
  TransformType::Pointer transform = TransformType::New();

  itk::TransformFileWriter::Pointer writer =
itk::TransformFileWriter::New();
  writer->SetInput(transform);
  writer->SetFileName(fileName);
  writer->Update();

  return EXIT_SUCCESS;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130714/9326e36c/attachment.htm>


More information about the Insight-developers mailing list