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 "itkElastixLogLevel.h"
39#include "itkImageSource.h"
40#include "itkMesh.h"
41#include "itkTransformBase.h"
42
43#include "elxElastixTemplate.h"
44#include "elxTransformBase.h"
45#include "elxTransformixMain.h"
46#include "elxParameterObject.h"
47
55namespace itk
56{
57
58template <typename TImage>
59class ITK_TEMPLATE_EXPORT TransformixFilter : public ImageSource<TImage>
60{
61public:
63
66 using Superclass = ImageSource<TImage>;
67 using Pointer = SmartPointer<Self>;
68 using ConstPointer = SmartPointer<const Self>;
69
71 itkNewMacro(Self);
72
74 itkTypeMacro(TransformixFilter, ImageSource);
75
80 using ArgumentMapEntryType = ArgumentMapType::value_type;
81
82 using DataObjectPointer = ProcessObject::DataObjectPointer;
83 using DataObjectIdentifierType = ProcessObject::DataObjectIdentifierType;
86
93
94 using typename Superclass::OutputImageType;
95 using typename Superclass::OutputImagePixelType;
96
98 typename itk::Image<itk::Vector<float, TImage::ImageDimension>, TImage::ImageDimension>;
99
100 using DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType;
101
102 using InputImageType = TImage;
103 itkStaticConstMacro(MovingImageDimension, unsigned int, TImage::ImageDimension);
104
105 using MeshType = Mesh<OutputImagePixelType, MovingImageDimension>;
106
107 using TransformType = Transform<double, MovingImageDimension, MovingImageDimension>;
108
110 using SpatialJacobianDeterminantImageType = itk::Image<float, MovingImageDimension>;
112 itk::Image<itk::Matrix<float, MovingImageDimension, MovingImageDimension>, MovingImageDimension>;
113
115 virtual void
116 SetMovingImage(TImage * inputImage);
117 const InputImageType *
119 virtual void
121
122 /* Standard filter indexed input / output methods */
123 void
124 SetInput(InputImageType * movingImage);
125 const InputImageType *
126 GetInput() const;
127 void
128 SetInput(DataObjectPointerArraySizeType index, DataObject * input);
129 const DataObject *
131
133 itkGetConstMacro(TransformParameterFileName, std::string);
134
136 itkSetMacro(FixedPointSetFileName, std::string);
137 itkGetConstMacro(FixedPointSetFileName, std::string);
138 virtual void
140 {
141 this->SetFixedPointSetFileName("");
142 }
143
145 itkSetMacro(ComputeSpatialJacobian, bool);
146 itkGetConstMacro(ComputeSpatialJacobian, bool);
147 itkBooleanMacro(ComputeSpatialJacobian);
148
150 itkSetMacro(ComputeDeterminantOfSpatialJacobian, bool);
151 itkGetConstMacro(ComputeDeterminantOfSpatialJacobian, bool);
152 itkBooleanMacro(ComputeDeterminantOfSpatialJacobian);
153
155 itkSetMacro(ComputeDeformationField, bool);
156 itkGetConstMacro(ComputeDeformationField, bool);
157 itkBooleanMacro(ComputeDeformationField);
158
160 virtual void
162
165
166 const ParameterObjectType *
168
169 using Superclass::GetOutput;
170 DataObject *
171 GetOutput(unsigned int idx);
172 const DataObject *
173 GetOutput(unsigned int idx) const;
174 OutputImageType *
176 const OutputImageType *
177 GetOutput() const;
178
181
184
186 itkSetMacro(OutputDirectory, std::string);
187 itkGetConstMacro(OutputDirectory, std::string);
188 virtual void
190 {
191 this->SetOutputDirectory("");
192 }
193
195 virtual void
196 SetLogFileName(std::string logFileName);
197
198 itkGetConstMacro(LogFileName, std::string);
199 virtual void
201
203 itkSetMacro(LogToConsole, bool);
204 itkGetConstMacro(LogToConsole, bool);
205 itkBooleanMacro(LogToConsole);
206
208 itkSetMacro(LogToFile, bool);
209 itkGetConstMacro(LogToFile, bool);
210 itkBooleanMacro(LogToFile);
211
213 void
215 {
216 m_EnableOutput = false;
217 }
218
219 itkSetMacro(LogLevel, ElastixLogLevel);
220 itkGetConstMacro(LogLevel, ElastixLogLevel);
221
223 itkSetConstObjectMacro(InputMesh, MeshType);
224
226 const MeshType *
228 {
229 return m_OutputMesh;
230 }
231
236 void
237 SetTransform(const TransformBase *);
238
243 void
245
246 itkSetObjectMacro(CombinationTransform, TransformType);
247
250 SmartPointer<SpatialJacobianDeterminantImageType>
252
255 SmartPointer<SpatialJacobianMatrixImageType>
257
258protected:
260
266
268 void
270
271 void
272 GenerateData() override;
273
274private:
276 using Superclass::SetInput;
277 using Superclass::MakeOutput;
278
280 static bool
281 IsEmpty(const InputImageType * inputImage);
282
286 using ProcessObject::RemoveInput;
287
289
292
293 SmartPointer<const elx::TransformixMain> m_TransformixMain{};
294
295 std::string m_TransformParameterFileName{};
296 std::string m_FixedPointSetFileName{};
297 bool m_ComputeSpatialJacobian{ false };
298 bool m_ComputeDeterminantOfSpatialJacobian{ false };
299 bool m_ComputeDeformationField{ false };
300
301 std::string m_OutputDirectory{};
302 std::string m_LogFileName{};
303
304 bool m_EnableOutput{ true };
305 bool m_LogToConsole{ false };
306 bool m_LogToFile{ false };
307
308 ElastixLogLevel m_LogLevel{};
309
310 SmartPointer<const MeshType> m_InputMesh{};
311 SmartPointer<MeshType> m_OutputMesh{};
312
313 SmartPointer<const TransformBase> m_Transform{};
314 SmartPointer<TransformType> m_ExternalTransform{};
315
316 SmartPointer<TransformType> m_CombinationTransform;
317};
318
319} // namespace itk
320
321#ifndef ITK_MANUAL_INSTANTIATION
322# include "itkTransformixFilter.hxx"
323#endif
324
325#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.
ElastixBase::DataObjectContainerType DataObjectContainerType
Definition elxMainBase.h:67
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
Definition elxMainBase.h:69
itk::SmartPointer< Self > Pointer
Configuration::CommandLineArgumentMapType ArgumentMapType
Definition elxMainBase.h:65
void SetInput(DataObjectPointerArraySizeType index, DataObject *input)
const InputImageType * GetMovingImage() const
virtual void SetLogFileName(std::string logFileName)
itk::Image< itk::Matrix< float, MovingImageDimension, MovingImageDimension >, MovingImageDimension > SpatialJacobianMatrixImageType
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
Transform< double, MovingImageDimension, MovingImageDimension > TransformType
ProcessObject::DataObjectPointer DataObjectPointer
DataObjectPointer MakeOutput(const DataObjectIdentifierType &key) override
void GenerateOutputInformation() override
virtual void RemoveLogFileName()
virtual void SetMovingImage(TImage *inputImage)
ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
TransformixMainType::DataObjectContainerType DataObjectContainerType
ITK_DISALLOW_COPY_AND_MOVE(TransformixFilter)
TransformixMainType::Pointer TransformixMainPointer
const DataObject * GetOutput(unsigned int idx) const
void SetInput(InputImageType *movingImage)
typename itk::Image< itk::Vector< float, TImage::ImageDimension >, TImage::ImageDimension > OutputDeformationFieldType
ParameterObjectType::ParameterMapType ParameterMapType
void GenerateData() override
SmartPointer< SpatialJacobianMatrixImageType > ComputeSpatialJacobianMatrixImage() const
virtual void RemoveMovingImage()
const ParameterObjectType * GetTransformParameterObject() const
ImageSource< TImage > Superclass
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
void SetTransformParameterFileName(std::string)
const InputImageType * GetInput() const
void SetTransform(const TransformBase *)
TransformixMainType::DataObjectContainerPointer DataObjectContainerPointer
OutputImageType * GetOutput()
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
const OutputDeformationFieldType * GetOutputDeformationField() const
const OutputImageType * GetOutput() const
const MeshType * GetOutputMesh() const
OutputDeformationFieldType * GetOutputDeformationField()
SmartPointer< SpatialJacobianDeterminantImageType > ComputeSpatialJacobianDeterminantImage() const
void SetExternalTransform(TransformType *)
typename ParameterObjectType::Pointer ParameterObjectPointer
DataObject * GetOutput(unsigned int idx)
SmartPointer< TransformType > m_CombinationTransform
itkStaticConstMacro(MovingImageDimension, unsigned int, TImage::ImageDimension)
const ElastixTransformBaseType * GetFirstElastixTransformBase() const
itk::Image< float, MovingImageDimension > SpatialJacobianDeterminantImageType
typename ParameterObjectType::ConstPointer ParameterObjectConstPointer
SmartPointer< const Self > ConstPointer
TransformixMainType::ArgumentMapType ArgumentMapType
ArgumentMapType::value_type ArgumentMapEntryType
const DataObject * GetInput(DataObjectPointerArraySizeType index) const
static bool IsEmpty(const InputImageType *inputImage)
Mesh< OutputImagePixelType, MovingImageDimension > MeshType
virtual void RemoveFixedPointSetFileName()
ParameterObjectType * GetTransformParameterObject()
virtual void SetTransformParameterObject(ParameterObjectType *transformParameterObject)


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo