go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkTransformixFilter.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/*=========================================================================
19 *
20 * Copyright UMC Utrecht and contributors
21 *
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
25 *
26 * http://www.apache.org/licenses/LICENSE-2.0.txt
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 *=========================================================================*/
35#ifndef itkTransformixFilter_h
36#define itkTransformixFilter_h
37
38#include "itkImageSource.h"
39#include "itkMesh.h"
40#include "itkTransformBase.h"
41
42#include "elxElastixTemplate.h"
43#include "elxTransformBase.h"
44#include "elxTransformixMain.h"
45#include "elxParameterObject.h"
46
54namespace itk
55{
56
57template <typename TMovingImage>
58class ITK_TEMPLATE_EXPORT TransformixFilter : public ImageSource<TMovingImage>
59{
60public:
62
65 using Superclass = ImageSource<TMovingImage>;
66 using Pointer = SmartPointer<Self>;
67 using ConstPointer = SmartPointer<const Self>;
68
70 itkNewMacro(Self);
71
73 itkTypeMacro(TransformixFilter, ImageSource);
74
79 using ArgumentMapEntryType = ArgumentMapType::value_type;
80
81 using DataObjectPointer = ProcessObject::DataObjectPointer;
82 using DataObjectIdentifierType = ProcessObject::DataObjectIdentifierType;
85
92
93 using typename Superclass::OutputImageType;
94 using typename Superclass::OutputImagePixelType;
95
97 typename itk::Image<itk::Vector<float, TMovingImage::ImageDimension>, TMovingImage::ImageDimension>;
98
99 using DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType;
100
101 using InputImageType = TMovingImage;
102 itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension);
103
104 using MeshType = Mesh<OutputImagePixelType, MovingImageDimension>;
105
106 using TransformType = Transform<double, MovingImageDimension, MovingImageDimension>;
107
109 using SpatialJacobianDeterminantImageType = itk::Image<float, MovingImageDimension>;
111 itk::Image<itk::Matrix<float, MovingImageDimension, MovingImageDimension>, MovingImageDimension>;
112
114 virtual void
115 SetMovingImage(TMovingImage * inputImage);
116 const InputImageType *
118 virtual void
120
121 /* Standard filter indexed input / output methods */
122 void
123 SetInput(InputImageType * movingImage);
124 const InputImageType *
125 GetInput() const;
126 void
127 SetInput(DataObjectPointerArraySizeType index, DataObject * input);
128 const DataObject *
130
132 itkSetMacro(FixedPointSetFileName, std::string);
133 itkGetConstMacro(FixedPointSetFileName, std::string);
134 virtual void
136 {
137 this->SetFixedPointSetFileName("");
138 }
139
141 itkSetMacro(ComputeSpatialJacobian, bool);
142 itkGetConstMacro(ComputeSpatialJacobian, bool);
143 itkBooleanMacro(ComputeSpatialJacobian);
144
146 itkSetMacro(ComputeDeterminantOfSpatialJacobian, bool);
147 itkGetConstMacro(ComputeDeterminantOfSpatialJacobian, bool);
148 itkBooleanMacro(ComputeDeterminantOfSpatialJacobian);
149
151 itkSetMacro(ComputeDeformationField, bool);
152 itkGetConstMacro(ComputeDeformationField, bool);
153 itkBooleanMacro(ComputeDeformationField);
154
156 virtual void
158
161
162 const ParameterObjectType *
164
165 using Superclass::GetOutput;
166 DataObject *
167 GetOutput(unsigned int idx);
168 const DataObject *
169 GetOutput(unsigned int idx) const;
170 OutputImageType *
172 const OutputImageType *
173 GetOutput() const;
174
177
180
182 itkSetMacro(OutputDirectory, std::string);
183 itkGetConstMacro(OutputDirectory, std::string);
184 virtual void
186 {
187 this->SetOutputDirectory("");
188 }
189
191 virtual void
192 SetLogFileName(std::string logFileName);
193
194 itkGetConstMacro(LogFileName, std::string);
195 virtual void
197
199 itkSetMacro(LogToConsole, bool);
200 itkGetConstMacro(LogToConsole, bool);
201 itkBooleanMacro(LogToConsole);
202
204 itkSetMacro(LogToFile, bool);
205 itkGetConstMacro(LogToFile, bool);
206 itkBooleanMacro(LogToFile);
207
209 void
211 {
212 m_EnableOutput = false;
213 }
214
216 itkSetConstObjectMacro(InputMesh, MeshType);
217
219 const MeshType *
221 {
222 return m_OutputMesh;
223 }
224
228 itkSetConstObjectMacro(Transform, TransformBase);
229
230 itkSetObjectMacro(CombinationTransform, TransformType);
231
234 SmartPointer<SpatialJacobianDeterminantImageType>
236
239 SmartPointer<SpatialJacobianMatrixImageType>
241
242protected:
244
250
252 void
254
255 void
256 GenerateData() override;
257
258private:
260 using Superclass::SetInput;
261 using Superclass::MakeOutput;
262
264 static bool
265 IsEmpty(const InputImageType * inputImage);
266
270 using ProcessObject::RemoveInput;
271
273
276
277 SmartPointer<const elx::TransformixMain> m_TransformixMain{ nullptr };
278
279 std::string m_FixedPointSetFileName{};
280 bool m_ComputeSpatialJacobian{ false };
281 bool m_ComputeDeterminantOfSpatialJacobian{ false };
282 bool m_ComputeDeformationField{ false };
283
284 std::string m_OutputDirectory{};
285 std::string m_LogFileName{};
286
287 bool m_EnableOutput{ true };
288 bool m_LogToConsole{ false };
289 bool m_LogToFile{ false };
290
291 typename MeshType::ConstPointer m_InputMesh{ nullptr };
292 typename MeshType::Pointer m_OutputMesh{ nullptr };
293
294 TransformBase::ConstPointer m_Transform;
295
296 SmartPointer<TransformType> m_CombinationTransform;
297};
298
299} // namespace itk
300
301#ifndef ITK_MANUAL_INSTANTIATION
302# include "itkTransformixFilter.hxx"
303#endif
304
305#endif
itk::SmartPointer< Self > Pointer
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
itk::SmartPointer< const Self > ConstPointer
std::vector< ParameterValueType > ParameterValueVectorType
std::vector< ParameterMapType > ParameterMapVectorType
This class is the elastix base class for all Transforms.
A class with all functionality to configure transformix.
Configuration::CommandLineArgumentMapType ArgumentMapType
ElastixBase::DataObjectContainerType DataObjectContainerType
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
itk::SmartPointer< Self > Pointer
ImageSource< TMovingImage > Superclass
ITK_DISALLOW_COPY_AND_MOVE(TransformixFilter)
SmartPointer< SpatialJacobianMatrixImageType > ComputeSpatialJacobianMatrixImage() const
ParameterObjectType * GetTransformParameterObject()
SmartPointer< SpatialJacobianDeterminantImageType > ComputeSpatialJacobianDeterminantImage() const
TransformBase::ConstPointer m_Transform
static bool IsEmpty(const InputImageType *inputImage)
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
SmartPointer< const Self > ConstPointer
void SetInput(DataObjectPointerArraySizeType index, DataObject *input)
typename ParameterObjectType::Pointer ParameterObjectPointer
ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
void GenerateOutputInformation() override
ArgumentMapType::value_type ArgumentMapEntryType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
typename itk::Image< itk::Vector< float, TMovingImage::ImageDimension >, TMovingImage::ImageDimension > OutputDeformationFieldType
void SetInput(InputImageType *movingImage)
const DataObject * GetInput(DataObjectPointerArraySizeType index) const
TransformixMainType::Pointer TransformixMainPointer
virtual void RemoveLogFileName()
Transform< double, MovingImageDimension, MovingImageDimension > TransformType
const ParameterObjectType * GetTransformParameterObject() const
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
itk::Image< float, MovingImageDimension > SpatialJacobianDeterminantImageType
TransformixMainType::DataObjectContainerType DataObjectContainerType
ProcessObject::DataObjectPointer DataObjectPointer
OutputDeformationFieldType * GetOutputDeformationField()
const OutputImageType * GetOutput() const
ParameterObjectType::ParameterMapType ParameterMapType
virtual void SetLogFileName(std::string logFileName)
Mesh< OutputImagePixelType, MovingImageDimension > MeshType
const MeshType * GetOutputMesh() const
const InputImageType * GetMovingImage() const
itk::Image< itk::Matrix< float, MovingImageDimension, MovingImageDimension >, MovingImageDimension > SpatialJacobianMatrixImageType
virtual void RemoveOutputDirectory()
virtual void SetMovingImage(TMovingImage *inputImage)
OutputImageType * GetOutput()
virtual void RemoveMovingImage()
const DataObject * GetOutput(unsigned int idx) const
const ElastixTransformBaseType * GetFirstElastixTransformBase() const
const InputImageType * GetInput() const
const OutputDeformationFieldType * GetOutputDeformationField() const
DataObject * GetOutput(unsigned int idx)
typename ParameterObjectType::ConstPointer ParameterObjectConstPointer
void GenerateData() override
TransformixMainType::ArgumentMapType ArgumentMapType
virtual void SetTransformParameterObject(ParameterObjectType *transformParameterObject)
TransformixMainType::DataObjectContainerPointer DataObjectContainerPointer
DataObjectPointer MakeOutput(const DataObjectIdentifierType &key) override
virtual void RemoveFixedPointSetFileName()
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
SmartPointer< TransformType > m_CombinationTransform


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo