go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxElastixFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 elxElastixFilter_h
19#define elxElastixFilter_h
20
21#include "itkImageSource.h"
22
23#include "elxElastixMain.h"
24#include "elxParameterObject.h"
25#include "elxPixelType.h"
26
32namespace elastix
33{
34
35template< typename TFixedImage, typename TMovingImage >
36class ELASTIXLIB_API ElastixFilter : public itk::ImageSource< TFixedImage >
37{
38public:
39
42 typedef itk::ImageSource< TFixedImage > Superclass;
43 typedef itk::SmartPointer< Self > Pointer;
44 typedef itk::SmartPointer< const Self > ConstPointer;
45
47 itkNewMacro( Self );
48
50 itkTypeMacro( ElastixFilter, itk::ImageSource );
51
55 typedef std::vector< ElastixMainPointer > ElastixMainVectorType;
58 typedef ArgumentMapType::value_type ArgumentMapEntryType;
60
63 typedef DataObjectContainerType::Iterator DataObjectContainerIterator;
64 typedef itk::ProcessObject::DataObjectIdentifierType DataObjectIdentifierType;
65 typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
66 typedef itk::ProcessObject::NameArray NameArrayType;
67
74
75 typedef typename TFixedImage::Pointer FixedImagePointer;
76 typedef typename TFixedImage::ConstPointer FixedImageConstPointer;
77 typedef typename TMovingImage::Pointer MovingImagePointer;
78 typedef typename TMovingImage::ConstPointer MovingImageConstPointer;
79
80 itkStaticConstMacro( FixedImageDimension, unsigned int, TFixedImage::ImageDimension );
81 itkStaticConstMacro( MovingImageDimension, unsigned int, TMovingImage::ImageDimension );
82
83 typedef itk::Image< unsigned char, FixedImageDimension > FixedMaskType;
84 typedef typename FixedMaskType::Pointer FixedMaskPointer;
85 typedef typename FixedMaskType::Pointer FixedMaskConstPointer;
86 typedef itk::Image< unsigned char, MovingImageDimension > MovingMaskType;
87 typedef typename MovingMaskType::Pointer MovingMaskPointer;
88 typedef typename MovingMaskType::Pointer MovingMaskConstPointer;
89
91 virtual void SetFixedImage( TFixedImage * fixedImage );
92 virtual void AddFixedImage( TFixedImage * fixedImage );
94 FixedImageConstPointer GetFixedImage( const unsigned int index ) const;
95 unsigned int GetNumberOfFixedImages( void ) const;
96
98 virtual void SetMovingImage( TMovingImage * movingImages );
99 virtual void AddMovingImage( TMovingImage * movingImage );
101 MovingImageConstPointer GetMovingImage( const unsigned int index ) const;
102 unsigned int GetNumberOfMovingImages( void ) const;
103
105 virtual void AddFixedMask( FixedMaskType * fixedMask );
106 virtual void SetFixedMask( FixedMaskType * fixedMask );
108 FixedMaskConstPointer GetFixedMask( const unsigned int index ) const;
109 void RemoveFixedMask( void );
110 unsigned int GetNumberOfFixedMasks( void ) const;
111
113 virtual void SetMovingMask( MovingMaskType * movingMask );
114 virtual void AddMovingMask( MovingMaskType * movingMask );
116 MovingMaskConstPointer GetMovingMask( const unsigned int index ) const;
117 virtual void RemoveMovingMask( void );
118 unsigned int GetNumberOfMovingMasks( void ) const;
119
121 virtual void SetParameterObject( ParameterObjectType * parameterObject );
124
128
130 itkSetMacro( InitialTransformParameterFileName, std::string );
131 itkGetMacro( InitialTransformParameterFileName, std::string );
132 virtual void RemoveInitialTransformParameterFileName( void ) { this->SetInitialTransformParameterFileName( "" ); }
133
135 itkSetMacro( FixedPointSetFileName, std::string );
136 itkGetMacro( FixedPointSetFileName, std::string );
137 void RemoveFixedPointSetFileName( void ) { this->SetFixedPointSetFileName( "" ); }
138
140 itkSetMacro( MovingPointSetFileName, std::string );
141 itkGetMacro( MovingPointSetFileName, std::string );
142 void RemoveMovingPointSetFileName( void ) { this->SetMovingPointSetFileName( "" ); }
143
145 itkSetMacro( OutputDirectory, std::string );
146 itkGetMacro( OutputDirectory, std::string );
147 void RemoveOutputDirectory() { this->SetOutputDirectory( "" ); }
148
150 void SetLogFileName( const std::string logFileName );
151
152 itkGetConstMacro( LogFileName, std::string );
153 void RemoveLogFileName( void );
154
156 itkSetMacro( LogToConsole, bool );
157 itkGetConstReferenceMacro( LogToConsole, bool );
158 itkBooleanMacro( LogToConsole );
159
161 itkSetMacro( LogToFile, bool );
162 itkGetConstReferenceMacro( LogToFile, bool );
163 itkBooleanMacro( LogToFile );
164
165 itkSetMacro( NumberOfThreads, int );
166 itkGetMacro( NumberOfThreads, int );
167
168protected:
169
171
172 virtual void GenerateData( void ) override;
173
174private:
175
176 ElastixFilter( const Self & ); // purposely not implemented
177 void operator=( const Self & ); // purposely not implemented
178
180 std::string MakeUniqueName( const DataObjectIdentifierType & key );
181
184
186 unsigned int GetNumberOfInputsOfType( const DataObjectIdentifierType & intputType );
187
190
194
195 std::string m_OutputDirectory;
196 std::string m_LogFileName;
197
200
202
203 unsigned int m_InputUID;
204
205};
206
207} // namespace elx
208
209#ifndef ITK_MANUAL_INSTANTIATION
210#include "elxElastixFilter.hxx"
211#endif
212
213#endif // elxElastixFilter_h
itk::ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
ElastixFilter(const Self &)
ElastixMainType::ObjectPointer ElastixMainObjectPointer
FixedImageConstPointer GetFixedImage(const unsigned int index) const
ElastixMainType::DataObjectContainerType DataObjectContainerType
ParameterObjectType::ParameterMapType ParameterMapType
virtual void AddMovingImage(TMovingImage *movingImage)
ParameterObjectType::ConstPointer ParameterObjectConstPointer
FixedImageConstPointer GetFixedImage(void) const
MovingImageConstPointer GetMovingImage(const unsigned int index) const
virtual void RemoveMovingMask(void)
ElastixMainType::FlatDirectionCosinesType FlatDirectionCosinesType
virtual void GenerateData(void) override
FixedMaskType::Pointer FixedMaskPointer
ParameterObjectType * GetParameterObject(void)
const ParameterObjectType * GetTransformParameterObject(void) const
void RemoveLogFileName(void)
itk::ProcessObject::NameArray NameArrayType
bool IsInputOfType(const DataObjectIdentifierType &InputOfType, DataObjectIdentifierType inputName)
ElastixMainType::DataObjectContainerPointer DataObjectContainerPointer
unsigned int GetNumberOfInputsOfType(const DataObjectIdentifierType &intputType)
virtual void RemoveInitialTransformParameterFileName(void)
itk::Image< unsigned char, MovingImageDimension > MovingMaskType
unsigned int GetNumberOfMovingImages(void) const
const ParameterObjectType * GetParameterObject(void) const
ArgumentMapType::value_type ArgumentMapEntryType
elastix::ElastixMain ElastixMainType
virtual void SetParameterObject(ParameterObjectType *parameterObject)
itk::ImageSource< TFixedImage > Superclass
itk::SmartPointer< const Self > ConstPointer
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
void RemoveInputsOfType(const DataObjectIdentifierType &inputName)
void SetLogFileName(const std::string logFileName)
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
FixedMaskConstPointer GetFixedMask(void) const
DataObjectContainerType::Iterator DataObjectContainerIterator
std::string MakeUniqueName(const DataObjectIdentifierType &key)
void RemoveMovingPointSetFileName(void)
std::vector< ElastixMainPointer > ElastixMainVectorType
TMovingImage::Pointer MovingImagePointer
ElastixMainType::Pointer ElastixMainPointer
std::string m_InitialTransformParameterFileName
unsigned int GetNumberOfFixedImages(void) const
TFixedImage::Pointer FixedImagePointer
virtual void AddFixedMask(FixedMaskType *fixedMask)
MovingMaskType::Pointer MovingMaskConstPointer
itk::Image< unsigned char, FixedImageDimension > FixedMaskType
FixedMaskConstPointer GetFixedMask(const unsigned int index) const
itk::SmartPointer< Self > Pointer
ParameterObjectType * GetTransformParameterObject(void)
unsigned int GetNumberOfMovingMasks(void) const
std::string m_FixedPointSetFileName
TFixedImage::ConstPointer FixedImageConstPointer
FixedMaskType::Pointer FixedMaskConstPointer
MovingMaskConstPointer GetMovingMask(const unsigned int index) const
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
virtual void SetFixedMask(FixedMaskType *fixedMask)
virtual void AddFixedImage(TFixedImage *fixedImage)
MovingImageConstPointer GetMovingImage(void) const
TMovingImage::ConstPointer MovingImageConstPointer
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
ParameterObject ParameterObjectType
virtual void SetMovingImage(TMovingImage *movingImages)
void operator=(const Self &)
virtual void AddMovingMask(MovingMaskType *movingMask)
virtual void SetMovingMask(MovingMaskType *movingMask)
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
MovingMaskConstPointer GetMovingMask(void) const
ParameterObjectType::Pointer ParameterObjectPointer
std::string m_MovingPointSetFileName
MovingMaskType::Pointer MovingMaskPointer
unsigned int GetNumberOfFixedMasks(void) const
virtual void SetFixedImage(TFixedImage *fixedImage)
void RemoveFixedPointSetFileName(void)
ElastixMainType::ArgumentMapType ArgumentMapType
void RemoveFixedMask(void)
A class with all functionality to configure elastix.
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
ObjectType::Pointer ObjectPointer
ElastixBase::DataObjectContainerType DataObjectContainerType
ConfigurationType::CommandLineArgumentMapType ArgumentMapType
itk::SmartPointer< Self > Pointer
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
itk::SmartPointer< const Self > ConstPointer
std::vector< ParameterValueType > ParameterValueVectorType
itk::SmartPointer< Self > Pointer
std::vector< ParameterMapType > ParameterMapVectorType
#define ELASTIXLIB_API
Definition: elxMacro.h:301


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo