18#ifndef sitkElastixImageFilter_h
19#define sitkElastixImageFilter_h
283 const unsigned int numberOfResolutions = 4u,
284 const double finalGridSpacingInPhysicalUnits = 10.0);
288 SetParameterMaps(
const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
299 std::vector<std::map<std::string, std::vector<std::string>>>
304 std::map<std::string, std::vector<std::string>>
306 const unsigned int numberOfResolutions = 4,
307 const double finalGridSpacingInPhysicalUnits = 10.0);
319 SetParameter(
const std::string key,
const std::vector<std::string> value);
324 SetParameter(
const unsigned int index,
const std::string key,
const std::string value);
329 SetParameter(
const unsigned int index,
const std::string key,
const std::vector<std::string> value);
338 AddParameter(
const unsigned int index,
const std::string key,
const std::string value);
342 AddParameter(
const std::string key,
const std::vector<std::string> value);
347 AddParameter(
const unsigned int index,
const std::string key,
const std::vector<std::string> value);
350 std::vector<std::string>
355 std::vector<std::string>
379 std::map<std::string, std::vector<std::string>>
384 WriteParameterFile(
const std::map<std::string, std::vector<std::string>> parameterMap,
const std::string filename);
395 std::vector<std::map<std::string, std::vector<std::string>>>
399 std::map<std::string, std::vector<std::string>>
420 const std::unique_ptr<ElastixImageFilterImpl>
m_Pimple;
426 const unsigned int numberOfResolutions = 4,
427 const double finalGridSpacingInPhysicalUnits = 8.0);
431WriteParameterFile(
const std::map<std::string, std::vector<std::string>> parameterMap,
const std::string filename);
435PrintParameterMap(
const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
438 const Image & movingImage,
439 const bool logToConsole =
false,
440 const bool logToFile =
false,
441 const std::string outputDirectory =
".");
444 const Image & movingImage,
445 const Image & fixedMask,
446 const Image & movingMask,
447 const bool logToConsole =
false,
448 const bool logToFile =
false,
449 const std::string outputDirectory =
".");
452 const Image & movingImage,
453 const std::string defaultParameterMapName,
454 const bool logToConsole =
false,
455 const bool logToFile =
false,
456 const std::string outputDirectory =
".");
459 const Image & movingImage,
460 const std::map<std::string, std::vector<std::string>> parameterMap,
461 const bool logToConsole =
false,
462 const bool logToFile =
false,
463 const std::string outputDirectory =
".");
466 const Image & movingImage,
467 const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
468 const bool logToConsole =
false,
469 const bool logToFile =
false,
470 const std::string outputDirectory =
".");
473 const Image & movingImage,
474 const std::string defaultParameterMapName,
475 const Image & fixedMask,
476 const Image & movingMask,
477 const bool logToConsole =
false,
478 const bool logToFile =
false,
479 const std::string outputDirectory =
".");
482 const Image & movingImage,
483 const std::map<std::string, std::vector<std::string>>,
484 const Image & fixedMask,
485 const Image & movingMask,
486 const bool logToConsole =
false,
487 const bool logToFile =
false,
488 const std::string outputDirectory =
".");
491 const Image & movingImage,
492 std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
493 const Image & fixedMask,
494 const Image & movingMask,
495 const bool logToConsole =
false,
496 const bool logToFile =
false,
497 const std::string outputDirectory =
".");
void SetFixedMask(const VectorOfImage &fixedMasks)
Sets multiple fixed masks. Stores the images into the container of fixed masks.
void PrintParameterMap(const ParameterMapVectorType parameterMapVector)
Prints the specified parameter maps to standard output.
void LogToConsoleOn()
Switches logging to console on.
void SetOutputDirectory(const std::string outputDirectory)
Sets the output directory.
void SetParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
Specifies a single parameter map.
void RemoveParameter(const std::string key)
Removes the parameter specified by key from all parameter maps.
void LogToFileOn()
Switches logging to file on.
void RemoveParameter(const unsigned int index, const std::string key)
Removes the parameter specified by key from the parameter map at the specified (zero-based) index.
Image & GetMovingImage(const unsigned long index)
Retrieves a reference to the moving image at the specified (zero-based) index.
std::string GetOutputDirectory()
Returns the current output directory.
std::vector< std::string > GetParameter(const std::string key)
Retrieves the values of the parameter specified by key, when there is only one parameter map.
bool GetLogToConsole()
Returns whether logging to console is switched on.
void RemoveMovingMask(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of moving masks.
std::string GetLogFileName()
Returns the name of the current log file.
void AddMovingMask(const Image &movingMask)
Adds an image to the end of the container of moving masks.
void SetMovingMask(const Image &movingMask)
Sets a moving mask. Stores the image into the container of moving masks.
void LogToFileOff()
Switches logging to file off.
void RemoveFixedImage(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of fixed images.
Image & GetMovingMask(const unsigned long index)
Retrieves a reference to the moving mask at the specified (zero-based) index.
void RemoveFixedMask()
Removes all fixed masks.
unsigned int GetNumberOfParameterMaps()
Returns the number of parameter maps.
std::string GetFixedPointSetFileName()
Returns the name of the current point set file of points from the fixed image.
void PrintParameterMap()
Prints all parameter maps to standard output.
void SetFixedPointSetFileName(const std::string fixedPointSetFileName)
Specifies a set of points from the fixed image by a point set file, fixedPointSetFileName.
unsigned int GetNumberOfFixedMasks()
Returns the number of fixed masks.
void RemoveMovingMask()
Removes all moving masks.
ParameterMapType::const_iterator ParameterMapConstIterator
std::vector< std::string > GetParameter(const unsigned int index, const std::string key)
Retrieves the values of the parameter specified by key, from the parameter map at the specified (zero...
void RemoveMovingImage(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of moving images.
bool GetLogToFile()
Returns whether logging to file is switched on.
void SetMovingPointSetFileName(const std::string movingPointSetFileName)
Specifies a set of points from the moving image by a point set file, movingPointSetFileName.
Image & GetFixedMask(const unsigned long index)
Retrieves a reference to the fixed mask at the specified (zero-based) index.
void AddMovingImage(const Image &movingImage)
Adds an image to the end of the container of moving images.
std::string ParameterKeyType
Image & GetFixedImage(const unsigned long index)
Retrieves a reference to the fixed image at the specified (zero-based) index.
void AddParameter(const unsigned int index, const std::string key, const std::vector< std::string > value)
Adds a parameter specified by key, with the specified values to the parameter map at the specified (z...
VectorOfImage & GetMovingImage()
Retrieves a reference to the moving image at the specified (zero-based) index.
VectorOfImage & GetMovingMask()
Retrieves a reference to the container of moving masks.
void RemoveFixedImage()
Removes all fixed images.
void SetNumberOfThreads(int n)
Sets the maximum number of threads to the specified number n.
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",...
void SetMovingImage(const VectorOfImage &movingImage)
Sets multiple moving images. Stores the images into the container of moving images.
void RemoveMovingPointSetFileName()
Clears the current point set file name of points from the moving image.
void AddParameter(const unsigned int index, const std::string key, const std::string value)
Adds a parameter specified by key, with the specified value to the parameter map at the specified (ze...
std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
Reads the parameter file specified by filename, and returns its content as a parameter map.
int GetNumberOfThreads()
Returns the current maximum number of threads.
std::vector< ParameterMapType > ParameterMapVectorType
std::map< std::string, std::vector< std::string > > GetTransformParameterMap(const unsigned int index)
Returns the transform parameter map at the specified (zero-based) index.
void PrintParameterMap(const ParameterMapType parameterMapVector)
Prints the specified parameter map to standard output.
void WriteParameterFile(const std::map< std::string, std::vector< std::string > > parameterMap, const std::string filename)
Writes a parameter map to the file, specified by filename.
void SetLogToConsole(bool)
Switches logging to console on (true) or off (false), as specified by its function argument.
std::string ParameterValueType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
void SetParameterMaps(const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector)
Specifies multiple parameter maps.
void AddParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
Adds a parameter map to the container of parameter maps.
void RemoveFixedPointSetFileName()
Clears the current point set file name of points from the fixed image.
void SetParameter(const std::string key, const std::string value)
Sets the value of the parameter specified by key, in all parameter maps.
std::string GetMovingPointSetFileName()
Returns the name of the current point set file of points from the moving image.
unsigned int GetNumberOfMovingImages()
Returns the number of moving images.
void SetFixedMask(const Image &fixedMask)
Sets a fixed mask. Stores the image into the container of fixed masks.
void SetFixedImage(const Image &fixedImage)
Sets a fixed image. Stores the image into the container of fixed images.
void SetMovingMask(const VectorOfImage &movingMasks)
Sets multiple moving masks. Stores the images into the container of moving masks.
ParameterValueVectorType::iterator ParameterValueVectorIterator
void SetFixedImage(const VectorOfImage &fixedImages)
Sets multiple fixed images. Stores the images into the container of fixed images.
VectorOfImage & GetFixedImage()
Retrieves a reference to the container of fixed images.
~ElastixImageFilter()
Destructor.
void SetMovingImage(const Image &movingImages)
Sets a moving image. Stores the image into the container of moving images.
void SetParameter(const unsigned int index, const std::string key, const std::vector< std::string > value)
Sets the values of the parameter specified by key, in the parameter map at the specified (zero-based)...
void RemoveLogFileName()
Clears the name of the current log file.
void SetParameter(const std::string key, const std::vector< std::string > value)
Sets the values of the parameter specified by key, in all parameter maps.
unsigned int GetNumberOfMovingMasks()
Returns the number of moving masks.
void RemoveMovingImage()
Removes all moving images.
VectorOfImage & GetFixedMask()
Retrieves a reference to the container of fixed masks.
void LogToConsoleOff()
Switches logging to console off.
void SetLogFileName(const std::string logFileName)
Sets the name of the current log file.
std::vector< ParameterValueType > ParameterValueVectorType
std::map< std::string, std::vector< std::string > > GetDefaultParameterMap(const std::string transformName, const unsigned int numberOfResolutions=4, const double finalGridSpacingInPhysicalUnits=10.0)
Returns the default parameter map for the specified function arguments (transformName may be "transla...
void AddFixedImage(const Image &fixedImage)
Adds an image to the end of the container of fixed images.
std::string GetName() const
void SetParameter(const unsigned int index, const std::string key, const std::string value)
Sets the value of the parameter specified by key, in the parameter map at the specified (zero-based) ...
std::string GetInitialTransformParameterFileName()
Returns the initial transform parameter file name.
std::vector< Image > VectorOfImage
unsigned int GetNumberOfFixedImages()
Returns the number of fixed images.
void RemoveFixedMask(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of fixed masks.
void SetInitialTransformParameterFileName(const std::string initialTransformParmaterFileName)
Specifies the initial transformation by the specified transform parameter file name.
void SetLogToFile(const bool logToFile)
Switches logging to file on (true) or off (false), as specified by its function argument.
const std::unique_ptr< ElastixImageFilterImpl > m_Pimple
void AddParameter(const std::string key, const std::vector< std::string > value)
Adds a parameter specified by key, with the specified values to all parameter maps.
std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMaps()
Returns all transform parameter maps.
Image GetResultImage()
Returns the result image.
void AddFixedMask(const Image &fixedMask)
Adds an image to the end of the container of fixed masks.
std::vector< std::map< std::string, std::vector< std::string > > > GetParameterMaps()
Returns a copy of the parameter maps.
ElastixImageFilter()
Default-constructor.
ParameterMapType::iterator ParameterMapIterator
void RemoveInitialTransformParameterFileName()
Clears the initial transform parameter file name.
Image Execute()
Executes the registration, and returns the result image.
void AddParameter(const std::string key, const std::string value)
Adds a parameter specified by key, with the specified value to all parameter maps.
void RemoveOutputDirectory()
Clears the name of the current output directory. (Does not remove the actual directory....
The Image class for SimpleITK.
SITKElastix_EXPORT Image Elastix(const Image &fixedImage, const Image &movingImage, const bool logToConsole=false, const bool logToFile=false, const std::string outputDirectory=".")
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)
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)