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  SetTransformParameterMaps(const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector) { return SetTransformParameterMap(parameterMapVector);}
130  SITK_RETURN_SELF_TYPE_HEADER
131  SetTransformParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
132  SITK_RETURN_SELF_TYPE_HEADER
133  AddTransformParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
134  std::vector<std::map<std::string, std::vector<std::string>>>
135  GetTransformParameterMap();
136  std::vector<std::map<std::string, std::vector<std::string>>>
137  GetTransformParameterMaps() { return GetTransformParameterMap(); }
138  unsigned int
139  GetNumberOfTransformParameterMaps();
140 
141  SITK_RETURN_SELF_TYPE_HEADER
142  SetTransformParameter(const std::string key, const std::string value);
143  SITK_RETURN_SELF_TYPE_HEADER
144  SetTransformParameter(const std::string key, const std::vector<std::string> value);
145  SITK_RETURN_SELF_TYPE_HEADER
146  SetTransformParameter(const unsigned int index, const std::string key, const std::string value);
147  SITK_RETURN_SELF_TYPE_HEADER
148  SetTransformParameter(const unsigned int index, const std::string key, const std::vector<std::string> value);
149  SITK_RETURN_SELF_TYPE_HEADER
150  AddTransformParameter(const std::string key, const std::string value);
151  SITK_RETURN_SELF_TYPE_HEADER
152  AddTransformParameter(const unsigned int index, const std::string key, const std::string value);
153  std::vector<std::string>
154  GetTransformParameter(const std::string key);
155  std::vector<std::string>
156  GetTransformParameter(const unsigned int index, const std::string key);
157  SITK_RETURN_SELF_TYPE_HEADER
158  RemoveTransformParameter(const std::string key);
159  SITK_RETURN_SELF_TYPE_HEADER
160  RemoveTransformParameter(const unsigned int index, const std::string key);
161 
162  std::map<std::string, std::vector<std::string>>
163  ReadParameterFile(const std::string parameterFileName);
164  SITK_RETURN_SELF_TYPE_HEADER
165  WriteParameterFile(const std::map<std::string, std::vector<std::string>> parameterMap,
166  const std::string parameterFileName);
167 
168  SITK_RETURN_SELF_TYPE_HEADER
170  SITK_RETURN_SELF_TYPE_HEADER
171  PrintParameterMap(const std::map<std::string, std::vector<std::string>> parameterMap);
172  SITK_RETURN_SELF_TYPE_HEADER
173  PrintParameterMap(const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector);
174 
175  Image
176  Execute();
177 
178  Image
179  GetResultImage();
180  Image
181  GetDeformationField();
182 
183 private:
184  class TransformixImageFilterImpl;
185  const std::unique_ptr<TransformixImageFilterImpl> m_Pimple;
186 };
187 
188 // Procedural Interface
190 Transformix(const Image & movingImage,
191  const std::map<std::string, std::vector<std::string>> parameterMap,
192  const bool logToConsole = false,
193  const std::string outputDirectory = ".");
195 Transformix(const Image & movingImage,
196  const std::vector<std::map<std::string, std::vector<std::string>>> parameterMapVector,
197  const bool logToConsole = false,
198  const std::string outputDirectory = ".");
199 
200 } // namespace itk::simple
201 
202 #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:184
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::GetTransformParameterMaps
std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMaps()
Definition: sitkTransformixImageFilter.h:137
itk::simple::TransformixImageFilter::SetTransformParameterMaps
Self & SetTransformParameterMaps(const std::vector< std::map< std::string, std::vector< std::string >>> parameterMapVector)
Definition: sitkTransformixImageFilter.h:129
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)