SimpleITK  
sitkElastixImageFilterImpl.h
Go to the documentation of this file.
1 #ifndef sitkelastiximagefilterimpl_h
2 #define sitkelastiximagefilterimpl_h
3 
4 // SimpleITK
8 
9 // Elastix
10 #include "itkElastixRegistrationMethod.h"
11 #include "elxParameterObject.h"
12 
13 namespace itk::simple {
14 
15 class SITKElastix_HIDDEN ElastixImageFilter::ElastixImageFilterImpl
16 {
17 public:
18  ElastixImageFilterImpl( void );
19  ~ElastixImageFilterImpl( void );
20 
21  typedef ElastixImageFilterImpl Self;
22 
24 
33 
34  typedef elastix::ParameterObject ParameterObjectType;
35  typedef elastix::ParameterObject::Pointer ParameterObjectPointer;
36 
37  std::string GetName( void ) const;
38 
39  void SetFixedImage( const Image& fixedImage );
40  void SetFixedImage( const VectorOfImage& fixedImages );
41  void AddFixedImage( const Image& fixedImage );
42  Image& GetFixedImage( const unsigned long index );
43  VectorOfImage& GetFixedImage( void );
44  void RemoveFixedImage( const unsigned long index );
45  void RemoveFixedImage( void );
46  unsigned int GetNumberOfFixedImages();
47 
48  void SetMovingImage( const Image& movingImages );
49  void SetMovingImage( const VectorOfImage& movingImage );
50  void AddMovingImage( const Image& movingImage );
51  Image& GetMovingImage( const unsigned long index );
52  VectorOfImage& GetMovingImage( void );
53  void RemoveMovingImage( const unsigned long index );
54  void RemoveMovingImage( void );
55  unsigned int GetNumberOfMovingImages();
56 
57  void SetFixedMask( const Image& fixedMask );
58  void SetFixedMask( const VectorOfImage& fixedMasks );
59  void AddFixedMask( const Image& fixedMask );
60  Image& GetFixedMask( const unsigned long index );
61  VectorOfImage& GetFixedMask( void );
62  void RemoveFixedMask( const unsigned long index );
63  void RemoveFixedMask( void );
64  unsigned int GetNumberOfFixedMasks();
65 
66  void SetMovingMask( const Image& movingMask );
67  void SetMovingMask( const VectorOfImage& movingMasks );
68  void AddMovingMask( const Image& movingMask );
69  Image& GetMovingMask( const unsigned long index );
70  VectorOfImage& GetMovingMask( void );
71  void RemoveMovingMask( const unsigned long index );
72  void RemoveMovingMask( void );
73  unsigned int GetNumberOfMovingMasks();
74 
75  void SetFixedPointSetFileName( const std::string movingPointSetFileName );
76  std::string GetFixedPointSetFileName( void );
77  void RemoveFixedPointSetFileName( void );
78 
79  void SetMovingPointSetFileName( const std::string movingPointSetFileName );
80  std::string GetMovingPointSetFileName( void );
81  void RemoveMovingPointSetFileName( void );
82 
83  void SetOutputDirectory( const std::string outputDirectory );
84  std::string GetOutputDirectory( void );
85  void RemoveOutputDirectory( void );
86 
87  void SetLogFileName( const std::string logFileName );
88  std::string GetLogFileName( void );
89  void RemoveLogFileName( void );
90 
91  void SetLogToFile( const bool logToFile );
92  bool GetLogToFile( void );
93  void LogToFileOn( void );
94  void LogToFileOff( void );
95 
96  void SetLogToConsole( bool );
97  bool GetLogToConsole( void );
98  void LogToConsoleOn();
99  void LogToConsoleOff();
100 
101  void SetNumberOfThreads( int n );
102  int GetNumberOfThreads( void );
103 
104  void SetParameterMap( const std::string transformName, const unsigned int numberOfResolutions = 4u, const double finalGridSpacingInPhysicalUnits = 10.0 );
105  void SetParameterMap( const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector );
106  void SetParameterMap( const std::map< std::string, std::vector< std::string > > parameterMap );
107  void AddParameterMap( const std::map< std::string, std::vector< std::string > > parameterMap );
108  std::vector< std::map< std::string, std::vector< std::string > > > GetParameterMap( void );
109  std::map< std::string, std::vector< std::string > > GetDefaultParameterMap( const std::string transformName, const unsigned int numberOfResolutions = 4, const double finalGridSpacingInPhysicalUnits = 10.0 );
110  unsigned int GetNumberOfParameterMaps( void );
111 
112  void SetParameter( const std::string key, const std::string value );
113  void SetParameter( const std::string key, const std::vector< std::string > value );
114  void SetParameter( const unsigned int index, const std::string key, const std::string value );
115  void SetParameter( const unsigned int index, const std::string key, const std::vector< std::string > value );
116  void AddParameter( const std::string key, const std::string value );
117  void AddParameter( const unsigned int index, const std::string key, const std::string value );
118  void AddParameter( const std::string key, const std::vector< std::string > value );
119  void AddParameter( const unsigned int index, const std::string key, const std::vector< std::string > value );
120  std::vector< std::string > GetParameter( const std::string key );
121  std::vector< std::string > GetParameter( const unsigned int index, const std::string key );
122  void RemoveParameter( const std::string key );
123  void RemoveParameter( const unsigned int index, const std::string key );
124 
125  void SetInitialTransformParameterFileName( const std::string initialTransformParmaterFileName );
126  std::string GetInitialTransformParameterFileName( void );
127  void RemoveInitialTransformParameterFileName( void );
128 
129  std::map< std::string, std::vector< std::string > > ReadParameterFile( const std::string filename );
130  void WriteParameterFile( const std::map< std::string, std::vector< std::string > > parameterMap, const std::string filename );
131 
132  Image Execute( void );
133  std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMap( void );
134  std::map< std::string, std::vector< std::string > > GetTransformParameterMap( const unsigned int index );
135  Image GetResultImage( void );
136 
137  void PrintParameterMap( void );
138  void PrintParameterMap( const ParameterMapType parameterMapVector );
139  void PrintParameterMap( const ParameterMapVectorType parameterMapVector );
140 
141  bool IsEmpty( const Image& image );
142 
143  // Definitions for SimpleITK member factory
144  typedef Image ( Self::*MemberFunctionType )( void );
145  template< class TFixedImage, class TMovingImage > Image DualExecuteInternal( void );
146  friend struct detail::DualExecuteInternalAddressor< MemberFunctionType >;
147  std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory;
148 
154 
158 
161 
162  std::string m_OutputDirectory;
163  std::string m_LogFileName;
164 
167 
169 
170 };
171 
172 }
173 
174 #endif // sitkelastiximagefilterimpl_h
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::ElastixImageFilter::m_FixedPointSetFileName
std::string m_FixedPointSetFileName
Definition: sitkElastixImageFilterImpl.h:156
itk::simple::ElastixImageFilter::VectorOfImage
ElastixImageFilter::VectorOfImage VectorOfImage
Definition: sitkElastixImageFilterImpl.h:23
itk::simple::ElastixImageFilter::m_ParameterMapVector
ParameterMapVectorType m_ParameterMapVector
Definition: sitkElastixImageFilterImpl.h:159
itk::simple::ElastixImageFilter::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition: sitkElastixImageFilter.h:51
itk::simple::ElastixImageFilter::m_FixedMasks
VectorOfImage m_FixedMasks
Definition: sitkElastixImageFilterImpl.h:151
itk::simple::ElastixImageFilter::m_LogFileName
std::string m_LogFileName
Definition: sitkElastixImageFilterImpl.h:163
itk::simple::ElastixImageFilter::ParameterMapType
ElastixImageFilter::ParameterMapType ParameterMapType
Definition: sitkElastixImageFilterImpl.h:29
itk::simple::ElastixImageFilter::m_ResultImage
Image m_ResultImage
Definition: sitkElastixImageFilterImpl.h:153
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
itk::simple::ElastixImageFilter::ParameterMapIterator
ParameterMapType::iterator ParameterMapIterator
Definition: sitkElastixImageFilter.h:55
sitkElastixImageFilter.h
itk::simple::ElastixImageFilter::ParameterValueType
std::string ParameterValueType
Definition: sitkElastixImageFilter.h:50
itk::simple::ElastixImageFilter::ParameterKeyType
std::string ParameterKeyType
Definition: sitkElastixImageFilter.h:49
itk::simple::ElastixImageFilter::m_MovingPointSetFileName
std::string m_MovingPointSetFileName
Definition: sitkElastixImageFilterImpl.h:157
itk::simple::ElastixImageFilter::VectorOfImage
std::vector< Image > VectorOfImage
Definition: sitkElastixImageFilter.h:47
itk::simple::ElastixImageFilter::m_MovingMasks
VectorOfImage m_MovingMasks
Definition: sitkElastixImageFilterImpl.h:152
itk::simple::ElastixImageFilter
The class that wraps the elastix registration library.
Definition: sitkElastixImageFilter.h:35
sitkMemberFunctionFactory.h
itk::simple::ElastixImageFilter::ParameterObjectPointer
elastix::ParameterObject::Pointer ParameterObjectPointer
Definition: sitkElastixImageFilterImpl.h:35
itk::simple::ElastixImageFilter::m_OutputDirectory
std::string m_OutputDirectory
Definition: sitkElastixImageFilterImpl.h:162
itk::simple::ElastixImageFilter::m_MovingImages
VectorOfImage m_MovingImages
Definition: sitkElastixImageFilterImpl.h:150
itk::simple::ElastixImageFilter::ParameterValueVectorType
ElastixImageFilter::ParameterValueVectorType ParameterValueVectorType
Definition: sitkElastixImageFilterImpl.h:27
SITKElastix_HIDDEN
#define SITKElastix_HIDDEN
Definition: sitkElastixTransformixWrappers.h:35
itk::simple::GetDefaultParameterMap
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)
itk::simple::ElastixImageFilter::m_LogToFile
bool m_LogToFile
Definition: sitkElastixImageFilterImpl.h:165
itk::simple::ElastixImageFilter::m_DualMemberFactory
std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
Definition: sitkElastixImageFilterImpl.h:147
itk::simple::ElastixImageFilter::m_LogToConsole
bool m_LogToConsole
Definition: sitkElastixImageFilterImpl.h:166
itk::simple::ElastixImageFilter::ParameterMapConstIterator
ParameterMapType::const_iterator ParameterMapConstIterator
Definition: sitkElastixImageFilter.h:56
itk::simple::ElastixImageFilter::ParameterKeyType
ElastixImageFilter::ParameterKeyType ParameterKeyType
Definition: sitkElastixImageFilterImpl.h:25
sitkDualMemberFunctionFactory.h
itk::simple::ElastixImageFilter::ParameterValueVectorIterator
ElastixImageFilter::ParameterValueVectorIterator ParameterValueVectorIterator
Definition: sitkElastixImageFilterImpl.h:28
itk::simple::ElastixImageFilter::m_InitialTransformParameterMapFileName
std::string m_InitialTransformParameterMapFileName
Definition: sitkElastixImageFilterImpl.h:155
itk::simple::ElastixImageFilter::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition: sitkElastixImageFilter.h:53
itk::simple::ElastixImageFilter::m_NumberOfThreads
int m_NumberOfThreads
Definition: sitkElastixImageFilterImpl.h:168
itk::simple::ElastixImageFilter::ParameterMapIterator
ElastixImageFilter::ParameterMapIterator ParameterMapIterator
Definition: sitkElastixImageFilterImpl.h:31
itk::simple::WriteParameterFile
SITKElastix_EXPORT void WriteParameterFile(const std::map< std::string, std::vector< std::string > > parameterMap, const std::string filename)
itk::simple::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:40
itk::simple::ElastixImageFilter::ParameterMapVectorType
ElastixImageFilter::ParameterMapVectorType ParameterMapVectorType
Definition: sitkElastixImageFilterImpl.h:30
itk::simple::ElastixImageFilter::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition: sitkElastixImageFilter.h:54
itk::simple::ElastixImageFilter::ParameterValueType
ElastixImageFilter::ParameterValueType ParameterValueType
Definition: sitkElastixImageFilterImpl.h:26
itk::simple::ElastixImageFilter::ParameterMapConstIterator
ElastixImageFilter::ParameterMapConstIterator ParameterMapConstIterator
Definition: sitkElastixImageFilterImpl.h:32
itk::simple::ElastixImageFilter::ParameterValueVectorIterator
ParameterValueVectorType::iterator ParameterValueVectorIterator
Definition: sitkElastixImageFilter.h:52
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::PrintParameterMap
SITKElastix_EXPORT void PrintParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
itk::simple::ElastixImageFilter::m_FixedImages
VectorOfImage m_FixedImages
Definition: sitkElastixImageFilterImpl.h:149
itk::simple::ElastixImageFilter::Self
ElastixImageFilterImpl Self
Definition: sitkElastixImageFilterImpl.h:21
itk::simple::ElastixImageFilter::m_TransformParameterMapVector
ParameterMapVectorType m_TransformParameterMapVector
Definition: sitkElastixImageFilterImpl.h:160
itk::simple::ElastixImageFilter::ParameterObjectType
elastix::ParameterObject ParameterObjectType
Definition: sitkElastixImageFilterImpl.h:34