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 
16 class SITKElastix_HIDDEN ElastixImageFilter::ElastixImageFilterImpl
17 {
18 public:
19  ElastixImageFilterImpl(void);
20  ~ElastixImageFilterImpl(void);
21 
22  typedef ElastixImageFilterImpl Self;
23 
25 
34 
35  typedef elastix::ParameterObject ParameterObjectType;
36  typedef elastix::ParameterObject::Pointer ParameterObjectPointer;
37 
38  std::string
39  GetName(void) const;
40 
41  void
42  SetFixedImage(const Image & fixedImage);
43  void
44  SetFixedImage(const VectorOfImage & fixedImages);
45  void
46  AddFixedImage(const Image & fixedImage);
47  Image &
48  GetFixedImage(const unsigned long index);
50  GetFixedImage(void);
51  void
52  RemoveFixedImage(const unsigned long index);
53  void
54  RemoveFixedImage(void);
55  unsigned int
56  GetNumberOfFixedImages();
57 
58  void
59  SetMovingImage(const Image & movingImages);
60  void
61  SetMovingImage(const VectorOfImage & movingImage);
62  void
63  AddMovingImage(const Image & movingImage);
64  Image &
65  GetMovingImage(const unsigned long index);
67  GetMovingImage(void);
68  void
69  RemoveMovingImage(const unsigned long index);
70  void
71  RemoveMovingImage(void);
72  unsigned int
73  GetNumberOfMovingImages();
74 
75  void
76  SetFixedMask(const Image & fixedMask);
77  void
78  SetFixedMask(const VectorOfImage & fixedMasks);
79  void
80  AddFixedMask(const Image & fixedMask);
81  Image &
82  GetFixedMask(const unsigned long index);
84  GetFixedMask(void);
85  void
86  RemoveFixedMask(const unsigned long index);
87  void
88  RemoveFixedMask(void);
89  unsigned int
90  GetNumberOfFixedMasks();
91 
92  void
93  SetMovingMask(const Image & movingMask);
94  void
95  SetMovingMask(const VectorOfImage & movingMasks);
96  void
97  AddMovingMask(const Image & movingMask);
98  Image &
99  GetMovingMask(const unsigned long index);
100  VectorOfImage &
101  GetMovingMask(void);
102  void
103  RemoveMovingMask(const unsigned long index);
104  void
105  RemoveMovingMask(void);
106  unsigned int
107  GetNumberOfMovingMasks();
108 
109  void
110  SetFixedPointSetFileName(const std::string movingPointSetFileName);
111  std::string
112  GetFixedPointSetFileName(void);
113  void
114  RemoveFixedPointSetFileName(void);
115 
116  void
117  SetMovingPointSetFileName(const std::string movingPointSetFileName);
118  std::string
119  GetMovingPointSetFileName(void);
120  void
121  RemoveMovingPointSetFileName(void);
122 
123  void
124  SetOutputDirectory(const std::string outputDirectory);
125  std::string
126  GetOutputDirectory(void);
127  void
128  RemoveOutputDirectory(void);
129 
130  void
131  SetLogFileName(const std::string logFileName);
132  std::string
133  GetLogFileName(void);
134  void
135  RemoveLogFileName(void);
136 
137  void
138  SetLogToFile(const bool logToFile);
139  bool
140  GetLogToFile(void);
141  void
142  LogToFileOn(void);
143  void
144  LogToFileOff(void);
145 
146  void
147  SetLogToConsole(bool);
148  bool
149  GetLogToConsole(void);
150  void
151  LogToConsoleOn();
152  void
153  LogToConsoleOff();
154 
155  void
156  SetNumberOfThreads(int n);
157  int
158  GetNumberOfThreads(void);
159 
160  void
161  SetParameterMap(const std::string transformName,
162  const unsigned int numberOfResolutions = 4u,
163  const double finalGridSpacingInPhysicalUnits = 10.0);
164  void
165  SetParameterMap(const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
166  void
167  SetParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
168  void
169  AddParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
170  std::vector<std::map<std::string, std::vector<std::string>>>
171  GetParameterMap(void);
172  std::map<std::string, std::vector<std::string>>
173  GetDefaultParameterMap(const std::string transformName,
174  const unsigned int numberOfResolutions = 4,
175  const double finalGridSpacingInPhysicalUnits = 10.0);
176  unsigned int
177  GetNumberOfParameterMaps(void);
178 
179  void
180  SetParameter(const std::string key, const std::string value);
181  void
182  SetParameter(const std::string key, const std::vector<std::string> value);
183  void
184  SetParameter(const unsigned int index, const std::string key, const std::string value);
185  void
186  SetParameter(const unsigned int index, const std::string key, const std::vector<std::string> value);
187  void
188  AddParameter(const std::string key, const std::string value);
189  void
190  AddParameter(const unsigned int index, const std::string key, const std::string value);
191  void
192  AddParameter(const std::string key, const std::vector<std::string> value);
193  void
194  AddParameter(const unsigned int index, const std::string key, const std::vector<std::string> value);
195  std::vector<std::string>
196  GetParameter(const std::string key);
197  std::vector<std::string>
198  GetParameter(const unsigned int index, const std::string key);
199  void
200  RemoveParameter(const std::string key);
201  void
202  RemoveParameter(const unsigned int index, const std::string key);
203 
204  void
205  SetInitialTransformParameterFileName(const std::string initialTransformParmaterFileName);
206  std::string
207  GetInitialTransformParameterFileName(void);
208  void
209  RemoveInitialTransformParameterFileName(void);
210 
211  std::map<std::string, std::vector<std::string>>
212  ReadParameterFile(const std::string filename);
213  void
214  WriteParameterFile(const std::map<std::string, std::vector<std::string>> parameterMap, const std::string filename);
215 
216  Image
217  Execute(void);
218  std::vector<std::map<std::string, std::vector<std::string>>>
219  GetTransformParameterMap(void);
220  std::map<std::string, std::vector<std::string>>
221  GetTransformParameterMap(const unsigned int index);
222  Image
223  GetResultImage(void);
224 
225  void
226  PrintParameterMap(void);
227  void
228  PrintParameterMap(const ParameterMapType parameterMapVector);
229  void
230  PrintParameterMap(const ParameterMapVectorType parameterMapVector);
231 
232  bool
233  IsEmpty(const Image & image);
234 
235  // Definitions for SimpleITK member factory
236  typedef Image (Self::*MemberFunctionType)(void);
237  template <class TFixedImage, class TMovingImage>
238  Image
239  DualExecuteInternal(void);
240  friend struct detail::DualExecuteInternalAddressor<MemberFunctionType>;
241  std::unique_ptr<detail::DualMemberFunctionFactory<MemberFunctionType>> m_DualMemberFactory;
242 
248 
252 
255 
256  std::string m_OutputDirectory;
257  std::string m_LogFileName;
258 
261 
263 };
264 
265 } // namespace itk::simple
266 
267 #endif // sitkelastiximagefilterimpl_h
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::PrintParameterMap
SITKElastix_EXPORT void PrintParameterMap(const std::map< std::string, std::vector< std::string >> parameterMap)
itk::simple::ElastixImageFilter::m_FixedPointSetFileName
std::string m_FixedPointSetFileName
Definition: sitkElastixImageFilterImpl.h:250
itk::simple::ElastixImageFilter::VectorOfImage
ElastixImageFilter::VectorOfImage VectorOfImage
Definition: sitkElastixImageFilterImpl.h:24
itk::simple::ElastixImageFilter::VectorOfImage
std::vector< Image > VectorOfImage
Definition: sitkElastixImageFilter.h:47
itk::simple::ElastixImageFilter::m_ParameterMapVector
ParameterMapVectorType m_ParameterMapVector
Definition: sitkElastixImageFilterImpl.h:253
itk::simple::ElastixImageFilter::m_FixedMasks
VectorOfImage m_FixedMasks
Definition: sitkElastixImageFilterImpl.h:245
itk::simple::ElastixImageFilter::m_LogFileName
std::string m_LogFileName
Definition: sitkElastixImageFilterImpl.h:257
itk::simple::ElastixImageFilter::ParameterMapType
ElastixImageFilter::ParameterMapType ParameterMapType
Definition: sitkElastixImageFilterImpl.h:30
itk::simple::ElastixImageFilter::m_ResultImage
Image m_ResultImage
Definition: sitkElastixImageFilterImpl.h:247
itk::simple::WriteParameterFile
SITKElastix_EXPORT void WriteParameterFile(const std::map< std::string, std::vector< std::string >> parameterMap, 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:251
itk::simple::ElastixImageFilter::m_MovingMasks
VectorOfImage m_MovingMasks
Definition: sitkElastixImageFilterImpl.h:246
itk::simple::ElastixImageFilter
The class that wraps the elastix registration library.
Definition: sitkElastixImageFilter.h:36
sitkMemberFunctionFactory.h
itk::simple::ElastixImageFilter::ParameterObjectPointer
elastix::ParameterObject::Pointer ParameterObjectPointer
Definition: sitkElastixImageFilterImpl.h:36
itk::simple::ElastixImageFilter::m_OutputDirectory
std::string m_OutputDirectory
Definition: sitkElastixImageFilterImpl.h:256
itk::simple::ElastixImageFilter::m_MovingImages
VectorOfImage m_MovingImages
Definition: sitkElastixImageFilterImpl.h:244
itk::simple::ElastixImageFilter::ParameterValueVectorType
ElastixImageFilter::ParameterValueVectorType ParameterValueVectorType
Definition: sitkElastixImageFilterImpl.h:28
itk::simple::ElastixImageFilter::m_DualMemberFactory
std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
Definition: sitkElastixImageFilterImpl.h:241
SITKElastix_HIDDEN
#define SITKElastix_HIDDEN
Definition: sitkElastixTransformixWrappers.h:35
itk::simple::ElastixImageFilter::m_LogToFile
bool m_LogToFile
Definition: sitkElastixImageFilterImpl.h:259
itk::simple::ElastixImageFilter::m_LogToConsole
bool m_LogToConsole
Definition: sitkElastixImageFilterImpl.h:260
itk::simple::ElastixImageFilter::ParameterMapConstIterator
ParameterMapType::const_iterator ParameterMapConstIterator
Definition: sitkElastixImageFilter.h:56
itk::simple::ElastixImageFilter::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition: sitkElastixImageFilter.h:51
itk::simple::ElastixImageFilter::ParameterKeyType
ElastixImageFilter::ParameterKeyType ParameterKeyType
Definition: sitkElastixImageFilterImpl.h:26
sitkDualMemberFunctionFactory.h
itk::simple::ElastixImageFilter::ParameterValueVectorIterator
ElastixImageFilter::ParameterValueVectorIterator ParameterValueVectorIterator
Definition: sitkElastixImageFilterImpl.h:29
itk::simple::ElastixImageFilter::m_InitialTransformParameterMapFileName
std::string m_InitialTransformParameterMapFileName
Definition: sitkElastixImageFilterImpl.h:249
itk::simple::ElastixImageFilter::m_NumberOfThreads
int m_NumberOfThreads
Definition: sitkElastixImageFilterImpl.h:262
itk::simple::ElastixImageFilter::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition: sitkElastixImageFilter.h:53
itk::simple::ElastixImageFilter::ParameterMapIterator
ElastixImageFilter::ParameterMapIterator ParameterMapIterator
Definition: sitkElastixImageFilterImpl.h:32
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::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:42
itk::simple::ElastixImageFilter::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition: sitkElastixImageFilter.h:54
itk::simple::ElastixImageFilter::ParameterMapVectorType
ElastixImageFilter::ParameterMapVectorType ParameterMapVectorType
Definition: sitkElastixImageFilterImpl.h:31
itk::simple::ElastixImageFilter::ParameterValueType
ElastixImageFilter::ParameterValueType ParameterValueType
Definition: sitkElastixImageFilterImpl.h:27
itk::simple::ElastixImageFilter::ParameterMapConstIterator
ElastixImageFilter::ParameterMapConstIterator ParameterMapConstIterator
Definition: sitkElastixImageFilterImpl.h:33
itk::simple::ElastixImageFilter::ParameterValueVectorIterator
ParameterValueVectorType::iterator ParameterValueVectorIterator
Definition: sitkElastixImageFilter.h:52
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::ElastixImageFilter::m_FixedImages
VectorOfImage m_FixedImages
Definition: sitkElastixImageFilterImpl.h:243
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
itk::simple::ElastixImageFilter::Self
ElastixImageFilterImpl Self
Definition: sitkElastixImageFilterImpl.h:22
itk::simple::ElastixImageFilter::m_TransformParameterMapVector
ParameterMapVectorType m_TransformParameterMapVector
Definition: sitkElastixImageFilterImpl.h:254
itk::simple::ElastixImageFilter::ParameterObjectType
elastix::ParameterObject ParameterObjectType
Definition: sitkElastixImageFilterImpl.h:35