SimpleITK  
sitkTransformixImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef sitkTransformixImageFilter_h
19 #define sitkTransformixImageFilter_h
20 
22 #include "sitkCommon.h"
23 #include "sitkImage.h"
24 
25 #include <map>
26 #include <memory> // For unique_ptr.
27 #include <string>
28 #include <vector>
29 
30 namespace itk::simple
31 {
32 
34 {
35 public:
38 
40 
41  typedef std::string ParameterKeyType;
42  typedef std::string ParameterValueType;
43  typedef std::vector<ParameterValueType> ParameterValueVectorType;
44  typedef ParameterValueVectorType::iterator ParameterValueVectorIterator;
45  typedef std::map<ParameterKeyType, ParameterValueVectorType> ParameterMapType;
46  typedef std::vector<ParameterMapType> ParameterMapVectorType;
47  typedef ParameterMapType::iterator ParameterMapIterator;
48  typedef ParameterMapType::const_iterator ParameterMapConstIterator;
49 
50  std::string
51  GetName() const;
52 
53  SITK_RETURN_SELF_TYPE_HEADER
54  SetMovingImage(const Image & movingImage);
55  Image &
56  GetMovingImage();
57  SITK_RETURN_SELF_TYPE_HEADER
58  RemoveMovingImage();
59 
60  SITK_RETURN_SELF_TYPE_HEADER
61  SetFixedPointSetFileName(const std::string movingPointSetFileName);
62  std::string
63  GetFixedPointSetFileName();
64  SITK_RETURN_SELF_TYPE_HEADER
65  RemoveFixedPointSetFileName();
66 
67  SITK_RETURN_SELF_TYPE_HEADER
68  SetComputeSpatialJacobian(const bool);
69  bool
70  GetComputeSpatialJacobian();
71  SITK_RETURN_SELF_TYPE_HEADER
72  ComputeSpatialJacobianOn();
73  SITK_RETURN_SELF_TYPE_HEADER
74  ComputeSpatialJacobianOff();
75 
76  SITK_RETURN_SELF_TYPE_HEADER
77  SetComputeDeterminantOfSpatialJacobian(const bool);
78  bool
79  GetComputeDeterminantOfSpatialJacobian();
80  SITK_RETURN_SELF_TYPE_HEADER
81  ComputeDeterminantOfSpatialJacobianOn();
82  SITK_RETURN_SELF_TYPE_HEADER
83  ComputeDeterminantOfSpatialJacobianOff();
84 
85  SITK_RETURN_SELF_TYPE_HEADER
86  SetComputeDeformationField(bool);
87  bool
88  GetComputeDeformationField();
89  SITK_RETURN_SELF_TYPE_HEADER
90  ComputeDeformationFieldOn();
91  SITK_RETURN_SELF_TYPE_HEADER
92  ComputeDeformationFieldOff();
93 
94  SITK_RETURN_SELF_TYPE_HEADER
95  SetOutputDirectory(const std::string outputDirectory);
96  std::string
97  GetOutputDirectory();
98  SITK_RETURN_SELF_TYPE_HEADER
99  RemoveOutputDirectory();
100 
101  SITK_RETURN_SELF_TYPE_HEADER
102  SetLogFileName(const std::string logFileName);
103  std::string
104  GetLogFileName();
105  SITK_RETURN_SELF_TYPE_HEADER
106  RemoveLogFileName();
107 
108  SITK_RETURN_SELF_TYPE_HEADER
109  SetLogToFile(const bool logToFile);
110  bool
111  GetLogToFile();
112  SITK_RETURN_SELF_TYPE_HEADER
113  LogToFileOn();
114  SITK_RETURN_SELF_TYPE_HEADER
115  LogToFileOff();
116 
117  SITK_RETURN_SELF_TYPE_HEADER
118  SetLogToConsole(const bool logToConsole);
119  bool
120  GetLogToConsole();
121  SITK_RETURN_SELF_TYPE_HEADER
122  LogToConsoleOn();
123  SITK_RETURN_SELF_TYPE_HEADER
124  LogToConsoleOff();
125 
126  SITK_RETURN_SELF_TYPE_HEADER
127  SetTransformParameterMap(const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
128  SITK_RETURN_SELF_TYPE_HEADER
129  SetTransformParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
130  SITK_RETURN_SELF_TYPE_HEADER
131  AddTransformParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
132  std::vector<std::map<std::string, std::vector<std::string>>>
133  GetTransformParameterMap();
134  unsigned int
135  GetNumberOfTransformParameterMaps();
136 
137  SITK_RETURN_SELF_TYPE_HEADER
138  SetTransformParameter(const std::string key, const std::string value);
139  SITK_RETURN_SELF_TYPE_HEADER
140  SetTransformParameter(const std::string key, const std::vector<std::string> value);
141  SITK_RETURN_SELF_TYPE_HEADER
142  SetTransformParameter(const unsigned int index, const std::string key, const std::string value);
143  SITK_RETURN_SELF_TYPE_HEADER
144  SetTransformParameter(const unsigned int index, const std::string key, const std::vector<std::string> value);
145  SITK_RETURN_SELF_TYPE_HEADER
146  AddTransformParameter(const std::string key, const std::string value);
147  SITK_RETURN_SELF_TYPE_HEADER
148  AddTransformParameter(const unsigned int index, const std::string key, const std::string value);
149  std::vector<std::string>
150  GetTransformParameter(const std::string key);
151  std::vector<std::string>
152  GetTransformParameter(const unsigned int index, const std::string key);
153  SITK_RETURN_SELF_TYPE_HEADER
154  RemoveTransformParameter(const std::string key);
155  SITK_RETURN_SELF_TYPE_HEADER
156  RemoveTransformParameter(const unsigned int index, const std::string key);
157 
158  std::map<std::string, std::vector<std::string>>
159  ReadParameterFile(const std::string parameterFileName);
160  SITK_RETURN_SELF_TYPE_HEADER
161  WriteParameterFile(const std::map<std::string, std::vector<std::string>> parameterMap,
162  const std::string parameterFileName);
163 
164  SITK_RETURN_SELF_TYPE_HEADER
166  SITK_RETURN_SELF_TYPE_HEADER
167  PrintParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
168  SITK_RETURN_SELF_TYPE_HEADER
169  PrintParameterMap(const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
170 
171  Image
172  Execute();
173 
174  Image
175  GetResultImage();
176  Image
177  GetDeformationField();
178 
179 private:
180  class TransformixImageFilterImpl;
181  const std::unique_ptr<TransformixImageFilterImpl> m_Pimple;
182 };
183 
184 // Procedural Interface
186 Transformix(const Image & movingImage,
187  const std::map<std::string, std::vector<std::string>> parameterMap,
188  const bool logToConsole = false,
189  const std::string outputDirectory = ".");
191 Transformix(const Image & movingImage,
192  const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
193  const bool logToConsole = false,
194  const std::string outputDirectory = ".");
195 
196 } // namespace itk::simple
197 
198 #endif // sitkTransformixImageFilter_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::TransformixImageFilter::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition: sitkTransformixImageFilter.h:43
itk::simple::TransformixImageFilter::ParameterMapIterator
ParameterMapType::iterator ParameterMapIterator
Definition: sitkTransformixImageFilter.h:47
itk::simple::WriteParameterFile
SITKElastix_EXPORT void WriteParameterFile(const std::map< std::string, std::vector< std::string >> parameterMap, const std::string filename)
itk::simple::TransformixImageFilter::ParameterValueType
std::string ParameterValueType
Definition: sitkTransformixImageFilter.h:42
sitkCommon.h
itk::simple::TransformixImageFilter
Definition: sitkTransformixImageFilter.h:33
sitkImage.h
SITKElastix_EXPORT
#define SITKElastix_EXPORT
Definition: sitkElastixTransformixWrappers.h:32
itk::simple::TransformixImageFilter::ParameterMapConstIterator
ParameterMapType::const_iterator ParameterMapConstIterator
Definition: sitkTransformixImageFilter.h:48
itk::simple::TransformixImageFilter::ParameterValueVectorIterator
ParameterValueVectorType::iterator ParameterValueVectorIterator
Definition: sitkTransformixImageFilter.h:44
itk::simple::TransformixImageFilter::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition: sitkTransformixImageFilter.h:46
sitkElastixTransformixWrappers.h
itk::simple::TransformixImageFilter::ParameterKeyType
std::string ParameterKeyType
Definition: sitkTransformixImageFilter.h:41
itk::simple::TransformixImageFilter::m_Pimple
const std::unique_ptr< TransformixImageFilterImpl > m_Pimple
Definition: sitkTransformixImageFilter.h:180
itk::simple::Transformix
SITKElastix_EXPORT Image Transformix(const Image &movingImage, const std::map< std::string, std::vector< std::string >> parameterMap, const bool logToConsole=false, const std::string outputDirectory=".")
itk::simple::TransformixImageFilter::Self
TransformixImageFilter Self
Definition: sitkTransformixImageFilter.h:39
itk::simple::TransformixImageFilter::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition: sitkTransformixImageFilter.h:45
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)