18#ifndef sitkElastixImageFilter_h
19#define sitkElastixImageFilter_h
62 SITK_RETURN_SELF_TYPE_HEADER
66 SITK_RETURN_SELF_TYPE_HEADER
70 SITK_RETURN_SELF_TYPE_HEADER
82 SITK_RETURN_SELF_TYPE_HEADER
86 SITK_RETURN_SELF_TYPE_HEADER
94 SITK_RETURN_SELF_TYPE_HEADER
98 SITK_RETURN_SELF_TYPE_HEADER
102 SITK_RETURN_SELF_TYPE_HEADER
114 SITK_RETURN_SELF_TYPE_HEADER
118 SITK_RETURN_SELF_TYPE_HEADER
126 SITK_RETURN_SELF_TYPE_HEADER
130 SITK_RETURN_SELF_TYPE_HEADER
134 SITK_RETURN_SELF_TYPE_HEADER
146 SITK_RETURN_SELF_TYPE_HEADER
150 SITK_RETURN_SELF_TYPE_HEADER
158 SITK_RETURN_SELF_TYPE_HEADER
162 SITK_RETURN_SELF_TYPE_HEADER
166 SITK_RETURN_SELF_TYPE_HEADER
178 SITK_RETURN_SELF_TYPE_HEADER
182 SITK_RETURN_SELF_TYPE_HEADER
190 SITK_RETURN_SELF_TYPE_HEADER
198 SITK_RETURN_SELF_TYPE_HEADER
202 SITK_RETURN_SELF_TYPE_HEADER
210 SITK_RETURN_SELF_TYPE_HEADER
214 SITK_RETURN_SELF_TYPE_HEADER
222 SITK_RETURN_SELF_TYPE_HEADER
226 SITK_RETURN_SELF_TYPE_HEADER
234 SITK_RETURN_SELF_TYPE_HEADER
238 SITK_RETURN_SELF_TYPE_HEADER
246 SITK_RETURN_SELF_TYPE_HEADER
250 SITK_RETURN_SELF_TYPE_HEADER
254 SITK_RETURN_SELF_TYPE_HEADER
262 SITK_RETURN_SELF_TYPE_HEADER
266 SITK_RETURN_SELF_TYPE_HEADER
272 SITK_RETURN_SELF_TYPE_HEADER
281 SITK_RETURN_SELF_TYPE_HEADER
283 const unsigned int numberOfResolutions = 4u,
284 const double finalGridSpacingInPhysicalUnits = 10.0);
287 SITK_RETURN_SELF_TYPE_HEADER
288 SetParameterMap(
const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
289 SITK_RETURN_SELF_TYPE_HEADER
290 SetParameterMaps(
const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector)
296 SITK_RETURN_SELF_TYPE_HEADER
300 SITK_RETURN_SELF_TYPE_HEADER
304 std::vector<std::map<std::string, std::vector<std::string>>>
306 std::vector<std::map<std::string, std::vector<std::string>>>
314 std::map<std::string, std::vector<std::string>>
316 const unsigned int numberOfResolutions = 4,
317 const double finalGridSpacingInPhysicalUnits = 10.0);
324 SITK_RETURN_SELF_TYPE_HEADER
328 SITK_RETURN_SELF_TYPE_HEADER
329 SetParameter(
const std::string key,
const std::vector<std::string> value);
333 SITK_RETURN_SELF_TYPE_HEADER
334 SetParameter(
const unsigned int index,
const std::string key,
const std::string value);
338 SITK_RETURN_SELF_TYPE_HEADER
339 SetParameter(
const unsigned int index,
const std::string key,
const std::vector<std::string> value);
342 SITK_RETURN_SELF_TYPE_HEADER
347 SITK_RETURN_SELF_TYPE_HEADER
348 AddParameter(
const unsigned int index,
const std::string key,
const std::string value);
351 SITK_RETURN_SELF_TYPE_HEADER
352 AddParameter(
const std::string key,
const std::vector<std::string> value);
356 SITK_RETURN_SELF_TYPE_HEADER
357 AddParameter(
const unsigned int index,
const std::string key,
const std::vector<std::string> value);
360 std::vector<std::string>
365 std::vector<std::string>
369 SITK_RETURN_SELF_TYPE_HEADER
373 SITK_RETURN_SELF_TYPE_HEADER
377 SITK_RETURN_SELF_TYPE_HEADER
385 SITK_RETURN_SELF_TYPE_HEADER
389 std::map<std::string, std::vector<std::string>>
393 SITK_RETURN_SELF_TYPE_HEADER
394 WriteParameterFile(
const std::map<std::string, std::vector<std::string>> parameterMap,
const std::string filename);
405 std::vector<std::map<std::string, std::vector<std::string>>>
409 std::map<std::string, std::vector<std::string>>
417 SITK_RETURN_SELF_TYPE_HEADER
421 SITK_RETURN_SELF_TYPE_HEADER
425 SITK_RETURN_SELF_TYPE_HEADER
430 const std::unique_ptr<ElastixImageFilterImpl>
m_Pimple;
436 const unsigned int numberOfResolutions = 4,
437 const double finalGridSpacingInPhysicalUnits = 8.0);
441WriteParameterFile(
const std::map<std::string, std::vector<std::string>> parameterMap,
const std::string filename);
445PrintParameterMap(
const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
448 const Image & movingImage,
449 const bool logToConsole =
false,
450 const bool logToFile =
false,
451 const std::string outputDirectory =
".");
454 const Image & movingImage,
455 const Image & fixedMask,
456 const Image & movingMask,
457 const bool logToConsole =
false,
458 const bool logToFile =
false,
459 const std::string outputDirectory =
".");
462 const Image & movingImage,
463 const std::string defaultParameterMapName,
464 const bool logToConsole =
false,
465 const bool logToFile =
false,
466 const std::string outputDirectory =
".");
469 const Image & movingImage,
470 const std::map<std::string, std::vector<std::string>> parameterMap,
471 const bool logToConsole =
false,
472 const bool logToFile =
false,
473 const std::string outputDirectory =
".");
476 const Image & movingImage,
477 const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
478 const bool logToConsole =
false,
479 const bool logToFile =
false,
480 const std::string outputDirectory =
".");
483 const Image & movingImage,
484 const std::string defaultParameterMapName,
485 const Image & fixedMask,
486 const Image & movingMask,
487 const bool logToConsole =
false,
488 const bool logToFile =
false,
489 const std::string outputDirectory =
".");
492 const Image & movingImage,
493 const std::map<std::string, std::vector<std::string>>,
494 const Image & fixedMask,
495 const Image & movingMask,
496 const bool logToConsole =
false,
497 const bool logToFile =
false,
498 const std::string outputDirectory =
".");
501 const Image & movingImage,
502 std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
503 const Image & fixedMask,
504 const Image & movingMask,
505 const bool logToConsole =
false,
506 const bool logToFile =
false,
507 const std::string outputDirectory =
".");
Self & AddParameter(const std::string key, const std::string value)
Adds a parameter specified by key, with the specified value to all parameter maps.
Self & SetLogToFile(const bool logToFile)
Switches logging to file on (true) or off (false), as specified by its function argument.
Self & SetMovingPointSetFileName(const std::string movingPointSetFileName)
Specifies a set of points from the moving image by a point set file, movingPointSetFileName.
std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMap()
Returns all transform parameter maps.
Self & SetInitialTransformParameterFileName(const std::string initialTransformParmaterFileName)
Specifies the initial transformation by the specified transform parameter file name.
Self & 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)...
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.
Self & SetParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
Specifies a single parameter map.
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.
Self & LogToConsoleOn()
Switches logging to console on.
Self & SetFixedMask(const Image &fixedMask)
Sets a fixed mask. Stores the image into the container of fixed masks.
bool GetLogToConsole()
Returns whether logging to console is switched on.
std::string GetLogFileName()
Returns the name of the current log file.
Self & SetOutputDirectory(const std::string outputDirectory)
Sets the output directory.
Self & RemoveFixedImage()
Removes all fixed images.
Self & RemoveMovingMask()
Removes all moving masks.
Image & GetMovingMask(const unsigned long index)
Retrieves a reference to the moving mask at the specified (zero-based) index.
Self & SetNumberOfThreads(int n)
Sets the maximum number of threads to the specified number n.
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.
unsigned int GetNumberOfFixedMasks()
Returns the number of fixed masks.
Self & 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) ...
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...
Self & 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...
Self & RemoveFixedMask()
Removes all fixed masks.
Self & RemoveInitialTransformParameterFileName()
Clears the initial transform parameter file name.
bool GetLogToFile()
Returns whether logging to file is switched on.
Image & GetFixedMask(const unsigned long index)
Retrieves a reference to the fixed mask at the specified (zero-based) index.
Self & AddMovingImage(const Image &movingImage)
Adds an image to the end of the container of moving images.
Self & SetParameterMaps(const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector)
std::string ParameterKeyType
Self & PrintParameterMap()
Prints all parameter maps to standard output.
Self & RemoveMovingPointSetFileName()
Clears the current point set file name of points from the moving image.
Image & GetFixedImage(const unsigned long index)
Retrieves a reference to the fixed image at the specified (zero-based) index.
Self & SetLogToConsole(bool)
Switches logging to console on (true) or off (false), as specified by its function argument.
Self & LogToFileOff()
Switches logging to file off.
VectorOfImage & GetMovingImage()
Retrieves a reference to the moving image at the specified (zero-based) index.
Self & SetParameterMap(const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector)
Specifies multiple parameter maps.
VectorOfImage & GetMovingMask()
Retrieves a reference to the container of moving masks.
Self & SetMovingImage(const VectorOfImage &movingImage)
Sets multiple moving images. Stores the images into the container of moving images.
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.
Self & LogToFileOn()
Switches logging to file on.
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.
Self & 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...
Self & SetMovingMask(const Image &movingMask)
Sets a moving mask. Stores the image into the container of moving masks.
std::string ParameterValueType
Self & RemoveMovingImage()
Removes all moving images.
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Self & RemoveMovingImage(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of moving images.
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.
std::vector< std::map< std::string, std::vector< std::string > > > GetParameterMap()
Returns a copy of the parameter maps.
Self & SetFixedImage(const VectorOfImage &fixedImages)
Sets multiple fixed images. Stores the images into the container of fixed images.
Self & 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.
Self & SetFixedPointSetFileName(const std::string fixedPointSetFileName)
Specifies a set of points from the fixed image by a point set file, fixedPointSetFileName.
Self & PrintParameterMap(const ParameterMapType parameterMapVector)
Prints the specified parameter map to standard output.
ParameterValueVectorType::iterator ParameterValueVectorIterator
VectorOfImage & GetFixedImage()
Retrieves a reference to the container of fixed images.
~ElastixImageFilter()
Destructor.
Self & RemoveFixedImage(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of fixed images.
Self & SetLogFileName(const std::string logFileName)
Sets the name of the current log file.
unsigned int GetNumberOfMovingMasks()
Returns the number of moving masks.
VectorOfImage & GetFixedMask()
Retrieves a reference to the container of fixed masks.
Self & RemoveLogFileName()
Clears the name of the current log file.
Self & SetParameter(const std::string key, const std::vector< std::string > value)
Sets the values of the parameter specified by key, in all parameter maps.
Self & LogToConsoleOff()
Switches logging to console off.
Self & 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",...
Self & 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.
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...
Self & PrintParameterMap(const ParameterMapVectorType parameterMapVector)
Prints the specified parameter maps to standard output.
Self & RemoveMovingMask(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of moving masks.
Self & 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.
std::string GetName() const
std::string GetInitialTransformParameterFileName()
Returns the initial transform parameter file name.
std::vector< Image > VectorOfImage
unsigned int GetNumberOfFixedImages()
Returns the number of fixed images.
Self & AddFixedMask(const Image &fixedMask)
Adds an image to the end of the container of fixed masks.
Self & AddFixedImage(const Image &fixedImage)
Adds an image to the end of the container of fixed images.
Self & AddParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
Adds a parameter map to the container of parameter maps.
const std::unique_ptr< ElastixImageFilterImpl > m_Pimple
Self & SetParameter(const std::string key, const std::string value)
Sets the value of the parameter specified by key, in all parameter maps.
Self & SetFixedImage(const Image &fixedImage)
Sets a fixed image. Stores the image into the container of fixed images.
Self & SetMovingImage(const Image &movingImages)
Sets a moving image. Stores the image into the container of moving images.
Self & AddMovingMask(const Image &movingMask)
Adds an image to the end of the container of moving masks.
Image GetResultImage()
Returns the result image.
Self & SetMovingMask(const VectorOfImage &movingMasks)
Sets multiple moving masks. Stores the images into the container of moving masks.
Self & RemoveFixedPointSetFileName()
Clears the current point set file name of points from the fixed image.
std::vector< std::map< std::string, std::vector< std::string > > > GetParameterMaps()
Self & RemoveFixedMask(const unsigned long index)
Removes an image at the specified (zero-based) index from the container of fixed masks.
Self & RemoveOutputDirectory()
Clears the name of the current output directory. (Does not remove the actual directory....
ElastixImageFilter()
Default-constructor.
ParameterMapType::iterator ParameterMapIterator
Image Execute()
Executes the registration, and returns the result image.
Self & RemoveParameter(const std::string key)
Removes the parameter specified by key from all parameter maps.
Self & SetFixedMask(const VectorOfImage &fixedMasks)
Sets multiple fixed masks. Stores the images into the container of fixed masks.
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)