#include <iostream>
#include <string>
int
main(int argc, char * argv[])
{
if (argc < 3)
{
std::cerr << "Usage: " << argv[0] << " <fixedImage> <movingImage> [outputPrefix]" << std::endl;
return 1;
}
std::cout << "SimpleITK Elastix Parameter Maps Example" << std::endl;
std::cout << std::string(60, '=') << std::endl;
if (argc > 3)
{
std::string outputPrefix = argv[3];
for (size_t i = 0; i < transformParameterMaps.size(); ++i)
{
std::string filename = outputPrefix + "_TransformParameters_" + std::to_string(i) + ".txt";
}
}
return 0;
}
The class that wraps the elastix registration library.
void SetParameterMap(const std::string transformName, const unsigned int numberOfResolutions=4u, const double finalGridSpacingInPhysicalUnits=10.0)
Specifies the parameter map by a transformName ("translation", "rigid" , "affine",...
std::vector< ParameterMapType > ParameterMapVectorType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
void AddParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
Adds a parameter map to the container of parameter maps.
void SetFixedImage(const Image &fixedImage)
Sets a fixed image. Stores the image into the container of fixed images.
void SetMovingImage(const Image &movingImages)
Sets a moving image. Stores the image into the container of moving images.
void LogToConsoleOff()
Switches logging to console off.
std::vector< ParameterValueType > ParameterValueVectorType
std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMaps()
Returns all transform parameter maps.
Image Execute()
Executes the registration, and returns the result image.
The Image class for SimpleITK.
SITKIO_EXPORT Image ReadImage(const PathType &filename, PixelIDValueEnum outputPixelType=sitkUnknown, const std::string &imageIO="")
ReadImage is a procedural interface to the ImageFileReader class which is convenient for most image r...
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > GetDefaultParameterMap(const std::string transform, const unsigned int numberOfResolutions=4, const double finalGridSpacingInPhysicalUnits=8.0)
SITKIO_EXPORT void WriteImage(const Image &image, const PathType &fileName, bool useCompression=false, int compressionLevel=-1)
WriteImage is a procedural interface to the ImageFileWriter. class which is convenient for many image...
SITKElastix_EXPORT void PrintParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
SITKElastix_EXPORT void WriteParameterFile(const std::map< std::string, std::vector< std::string > > parameterMap, const std::string filename)