ITK  4.13.0
Insight Segmentation and Registration Toolkit
WikiExamples/IO/TransformFileWriter.cxx
#include "itkVersion.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();
#if (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 5) || ITK_VERSION_MAJOR > 4
#else
#endif
writer->SetInput(transform);
writer->SetFileName(fileName);
writer->Update();
return EXIT_SUCCESS;
}