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 
33 {
34 public:
35 
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 GetName() const;
51 
52  SITK_RETURN_SELF_TYPE_HEADER SetMovingImage( const Image& movingImage );
53  Image& GetMovingImage();
54  SITK_RETURN_SELF_TYPE_HEADER RemoveMovingImage();
55 
56  SITK_RETURN_SELF_TYPE_HEADER SetFixedPointSetFileName( const std::string movingPointSetFileName );
57  std::string GetFixedPointSetFileName();
58  SITK_RETURN_SELF_TYPE_HEADER RemoveFixedPointSetFileName();
59 
60  SITK_RETURN_SELF_TYPE_HEADER SetComputeSpatialJacobian( const bool );
61  bool GetComputeSpatialJacobian();
62  SITK_RETURN_SELF_TYPE_HEADER ComputeSpatialJacobianOn();
63  SITK_RETURN_SELF_TYPE_HEADER ComputeSpatialJacobianOff();
64 
65  SITK_RETURN_SELF_TYPE_HEADER SetComputeDeterminantOfSpatialJacobian( const bool );
66  bool GetComputeDeterminantOfSpatialJacobian();
67  SITK_RETURN_SELF_TYPE_HEADER ComputeDeterminantOfSpatialJacobianOn();
68  SITK_RETURN_SELF_TYPE_HEADER ComputeDeterminantOfSpatialJacobianOff();
69 
70  SITK_RETURN_SELF_TYPE_HEADER SetComputeDeformationField( bool );
71  bool GetComputeDeformationField();
72  SITK_RETURN_SELF_TYPE_HEADER ComputeDeformationFieldOn();
73  SITK_RETURN_SELF_TYPE_HEADER ComputeDeformationFieldOff();
74 
75  SITK_RETURN_SELF_TYPE_HEADER SetOutputDirectory( const std::string outputDirectory );
76  std::string GetOutputDirectory();
77  SITK_RETURN_SELF_TYPE_HEADER RemoveOutputDirectory();
78 
79  SITK_RETURN_SELF_TYPE_HEADER SetLogFileName( const std::string logFileName );
80  std::string GetLogFileName();
81  SITK_RETURN_SELF_TYPE_HEADER RemoveLogFileName();
82 
83  SITK_RETURN_SELF_TYPE_HEADER SetLogToFile( const bool logToFile );
84  bool GetLogToFile();
85  SITK_RETURN_SELF_TYPE_HEADER LogToFileOn();
86  SITK_RETURN_SELF_TYPE_HEADER LogToFileOff();
87 
88  SITK_RETURN_SELF_TYPE_HEADER SetLogToConsole( const bool logToConsole );
89  bool GetLogToConsole();
90  SITK_RETURN_SELF_TYPE_HEADER LogToConsoleOn();
91  SITK_RETURN_SELF_TYPE_HEADER LogToConsoleOff();
92 
93  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameterMap( const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector );
94  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameterMap( const std::map< std::string, std::vector< std::string > > parameterMap );
95  SITK_RETURN_SELF_TYPE_HEADER AddTransformParameterMap( const std::map< std::string, std::vector< std::string > > parameterMap );
96  std::vector< std::map< std::string, std::vector< std::string > > > GetTransformParameterMap();
97  unsigned int GetNumberOfTransformParameterMaps();
98 
99  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameter( const std::string key, const std::string value );
100  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameter( const std::string key, const std::vector< std::string > value );
101  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameter( const unsigned int index, const std::string key, const std::string value );
102  SITK_RETURN_SELF_TYPE_HEADER SetTransformParameter( const unsigned int index, const std::string key, const std::vector< std::string > value );
103  SITK_RETURN_SELF_TYPE_HEADER AddTransformParameter( const std::string key, const std::string value );
104  SITK_RETURN_SELF_TYPE_HEADER AddTransformParameter( const unsigned int index, const std::string key, const std::string value );
105  std::vector< std::string > GetTransformParameter( const std::string key );
106  std::vector< std::string > GetTransformParameter( const unsigned int index, const std::string key );
107  SITK_RETURN_SELF_TYPE_HEADER RemoveTransformParameter( const std::string key );
108  SITK_RETURN_SELF_TYPE_HEADER RemoveTransformParameter( const unsigned int index, const std::string key );
109 
110  std::map< std::string, std::vector< std::string > > ReadParameterFile( const std::string parameterFileName );
111  SITK_RETURN_SELF_TYPE_HEADER WriteParameterFile( const std::map< std::string, std::vector< std::string > > parameterMap, const std::string parameterFileName );
112 
113  SITK_RETURN_SELF_TYPE_HEADER PrintParameterMap();
114  SITK_RETURN_SELF_TYPE_HEADER PrintParameterMap( const std::map< std::string, std::vector< std::string > > parameterMap );
115  SITK_RETURN_SELF_TYPE_HEADER PrintParameterMap( const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector );
116 
117  Image Execute();
118 
119  Image GetResultImage();
120  Image GetDeformationField();
121 
122 private:
123 
124  class TransformixImageFilterImpl;
125  const std::unique_ptr<TransformixImageFilterImpl> m_Pimple;
126 
127 };
128 
129 // Procedural Interface
130 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 = "." );
131 SITKElastix_EXPORT Image Transformix( const Image& movingImage, const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector, const bool logToConsole = false, const std::string outputDirectory = "." );
132 
133 }
134 
135 #endif // sitkTransformixImageFilter_h
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
itk::simple::TransformixImageFilter::ParameterMapIterator
ParameterMapType::iterator ParameterMapIterator
Definition: sitkTransformixImageFilter.h:47
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
itk::simple::TransformixImageFilter::ParameterValueType
std::string ParameterValueType
Definition: sitkTransformixImageFilter.h:42
sitkCommon.h
itk::simple::TransformixImageFilter
Definition: sitkTransformixImageFilter.h:32
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
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:124
itk::simple::WriteParameterFile
SITKElastix_EXPORT void WriteParameterFile(const std::map< std::string, std::vector< std::string > > parameterMap, const std::string filename)
itk::simple::TransformixImageFilter::Self
TransformixImageFilter Self
Definition: sitkTransformixImageFilter.h:39
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
Definition: sitkAdditionalProcedures.h:28
itk::simple::PrintParameterMap
SITKElastix_EXPORT void PrintParameterMap(const std::map< std::string, std::vector< std::string > > parameterMap)
itk::simple::TransformixImageFilter::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition: sitkTransformixImageFilter.h:45
itk::simple::TransformixImageFilter::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition: sitkTransformixImageFilter.h:43
itk::simple::TransformixImageFilter::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition: sitkTransformixImageFilter.h:46