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 
32 namespace elastix
33 {
34 
35 template< typename TFixedImage, typename TMovingImage >
36 class ELASTIXLIB_API ElastixFilter : public itk::ImageSource< TFixedImage >
37 {
38 public:
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( Self, 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 
168 protected:
169 
170  ElastixFilter( void );
171 
172  virtual void GenerateData( void ) ITK_OVERRIDE;
173 
174 private:
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 
183  bool IsInputOfType( const DataObjectIdentifierType & InputOfType, DataObjectIdentifierType inputName );
184 
186  unsigned int GetNumberOfInputsOfType( const DataObjectIdentifierType & intputType );
187 
189  void RemoveInputsOfType( const DataObjectIdentifierType & inputName );
190 
192  virtual void VerifyInputInformation( void ) ITK_OVERRIDE {};
193 
197 
198  std::string m_OutputDirectory;
199  std::string m_LogFileName;
200 
203 
205 
206  unsigned int m_InputUID;
207 
208 };
209 
210 } // namespace elx
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "elxElastixFilter.hxx"
214 #endif
215 
216 #endif // elxElastixFilter_h
elastix::ElastixFilter::MovingMaskPointer
MovingMaskType::Pointer MovingMaskPointer
Definition: elxElastixFilter.h:87
elastix::ElastixFilter::GetNumberOfMovingImages
unsigned int GetNumberOfMovingImages(void) const
elastix::ParameterObject::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition: elxParameterObject.h:51
elastix::ElastixFilter::m_LogToFile
bool m_LogToFile
Definition: elxElastixFilter.h:202
elastix::ElastixFilter::ElastixMainType
elastix::ElastixMain ElastixMainType
Definition: elxElastixFilter.h:50
elastix::ElastixFilter::m_LogToConsole
bool m_LogToConsole
Definition: elxElastixFilter.h:201
elxElastixMain.h
elastix::ElastixFilter::m_LogFileName
std::string m_LogFileName
Definition: elxElastixFilter.h:199
elastix::ElastixFilter::SetParameterObject
virtual void SetParameterObject(ParameterObjectType *parameterObject)
elastix::ElastixFilter::SetMovingMask
virtual void SetMovingMask(MovingMaskType *movingMask)
ELASTIXLIB_API
#define ELASTIXLIB_API
Definition: elxMacro.h:301
elastix::ElastixFilter::FixedImagePointer
TFixedImage::Pointer FixedImagePointer
Definition: elxElastixFilter.h:75
elastix::ElastixFilter::AddMovingMask
virtual void AddMovingMask(MovingMaskType *movingMask)
elastix::ElastixFilter::SetFixedMask
virtual void SetFixedMask(FixedMaskType *fixedMask)
elastix::ElastixFilter::GetFixedMask
FixedMaskConstPointer GetFixedMask(void) const
elastix::ElastixFilter::IsInputOfType
bool IsInputOfType(const DataObjectIdentifierType &InputOfType, DataObjectIdentifierType inputName)
elastix::ElastixFilter::DataObjectContainerPointer
ElastixMainType::DataObjectContainerPointer DataObjectContainerPointer
Definition: elxElastixFilter.h:62
elastix::ElastixFilter::SetFixedImage
virtual void SetFixedImage(TFixedImage *fixedImage)
elastix::ElastixFilter::GetNumberOfInputsOfType
unsigned int GetNumberOfInputsOfType(const DataObjectIdentifierType &intputType)
elastix::ElastixFilter::ArgumentMapType
ElastixMainType::ArgumentMapType ArgumentMapType
Definition: elxElastixFilter.h:57
elastix::ElastixFilter::RemoveInputsOfType
void RemoveInputsOfType(const DataObjectIdentifierType &inputName)
elastix::ElastixFilter::ParameterMapVectorType
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
Definition: elxElastixFilter.h:70
elastix::ElastixFilter::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: elxElastixFilter.h:65
elastix::ElastixFilter::FixedMaskConstPointer
FixedMaskType::Pointer FixedMaskConstPointer
Definition: elxElastixFilter.h:85
elastix::ElastixFilter::GetNumberOfMovingMasks
unsigned int GetNumberOfMovingMasks(void) const
elastix::ElastixMain::Pointer
itk::SmartPointer< Self > Pointer
Definition: elxElastixMain.h:105
elastix::ElastixFilter::VerifyInputInformation
virtual void VerifyInputInformation(void) ITK_OVERRIDE
Definition: elxElastixFilter.h:192
elastix::ElastixFilter::GetTransformParameterObject
const ParameterObjectType * GetTransformParameterObject(void) const
elastix::ElastixFilter::ElastixMainPointer
ElastixMainType::Pointer ElastixMainPointer
Definition: elxElastixFilter.h:54
elastix::ElastixFilter::m_OutputDirectory
std::string m_OutputDirectory
Definition: elxElastixFilter.h:198
elastix::ElastixFilter::GetFixedMask
FixedMaskConstPointer GetFixedMask(const unsigned int index) const
elastix::ElastixFilter::ParameterObjectPointer
ParameterObjectType::Pointer ParameterObjectPointer
Definition: elxElastixFilter.h:72
elastix::ElastixFilter::m_MovingPointSetFileName
std::string m_MovingPointSetFileName
Definition: elxElastixFilter.h:196
elastix::ElastixFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: elxElastixFilter.h:43
elastix::ElastixMain::DataObjectContainerType
ElastixBase::DataObjectContainerType DataObjectContainerType
Definition: elxElastixMain.h:128
elastix::ElastixFilter::AddMovingImage
virtual void AddMovingImage(TMovingImage *movingImage)
elastix::ElastixFilter::GetMovingMask
MovingMaskConstPointer GetMovingMask(void) const
elastix::ElastixFilter::ParameterObjectType
ParameterObject ParameterObjectType
Definition: elxElastixFilter.h:68
elastix::ElastixFilter::MovingImagePointer
TMovingImage::Pointer MovingImagePointer
Definition: elxElastixFilter.h:77
elastix::ElastixFilter::ParameterValueVectorType
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
Definition: elxElastixFilter.h:71
elastix::ElastixFilter::FixedMaskPointer
FixedMaskType::Pointer FixedMaskPointer
Definition: elxElastixFilter.h:84
elastix::ElastixFilter::GetMovingImage
MovingImageConstPointer GetMovingImage(void) const
elastix::ElastixFilter::RemoveFixedMask
void RemoveFixedMask(void)
elastix::ElastixFilter::GetParameterObject
const ParameterObjectType * GetParameterObject(void) const
elxParameterObject.h
elastix::ElastixFilter::ParameterObjectConstPointer
ParameterObjectType::ConstPointer ParameterObjectConstPointer
Definition: elxElastixFilter.h:73
elastix::ElastixFilter::FixedImageConstPointer
TFixedImage::ConstPointer FixedImageConstPointer
Definition: elxElastixFilter.h:76
elastix::ElastixMain::ArgumentMapType
ConfigurationType::CommandLineArgumentMapType ArgumentMapType
Definition: elxElastixMain.h:125
elastix::ElastixFilter
Definition: elxElastixFilter.h:37
elastix::ElastixFilter::GetNumberOfFixedImages
unsigned int GetNumberOfFixedImages(void) const
elastix::ElastixMain::ObjectPointer
ObjectType::Pointer ObjectPointer
Definition: elxElastixMain.h:118
elastix::ElastixFilter::ElastixFilter
ElastixFilter(const Self &)
elastix::ElastixFilter::GetMovingMask
MovingMaskConstPointer GetMovingMask(const unsigned int index) const
elastix::ElastixFilter::DataObjectContainerType
ElastixMainType::DataObjectContainerType DataObjectContainerType
Definition: elxElastixFilter.h:61
elastix::ElastixFilter::ParameterMapType
ParameterObjectType::ParameterMapType ParameterMapType
Definition: elxElastixFilter.h:69
elastix::ElastixFilter::RemoveFixedPointSetFileName
void RemoveFixedPointSetFileName(void)
Definition: elxElastixFilter.h:137
elastix::ElastixFilter::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
elastix::ElastixFilter::AddFixedMask
virtual void AddFixedMask(FixedMaskType *fixedMask)
elastix::ElastixFilter::SetMovingImage
virtual void SetMovingImage(TMovingImage *movingImages)
elastix::ElastixFilter::ElastixMainObjectPointer
ElastixMainType::ObjectPointer ElastixMainObjectPointer
Definition: elxElastixFilter.h:56
elastix::ElastixFilter::ElastixFilter
ElastixFilter(void)
elastix::ElastixFilter::Superclass
itk::ImageSource< TFixedImage > Superclass
Definition: elxElastixFilter.h:42
elastix::ElastixFilter::m_FixedPointSetFileName
std::string m_FixedPointSetFileName
Definition: elxElastixFilter.h:195
elastix::ElastixFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: elxElastixFilter.h:44
elastix::ElastixFilter::SetLogFileName
void SetLogFileName(const std::string logFileName)
elastix::ElastixMain::FlatDirectionCosinesType
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
Definition: elxElastixMain.h:131
elastix::ElastixFilter::FlatDirectionCosinesType
ElastixMainType::FlatDirectionCosinesType FlatDirectionCosinesType
Definition: elxElastixFilter.h:59
elastix::ElastixFilter::GetFixedImage
FixedImageConstPointer GetFixedImage(const unsigned int index) const
elastix::ElastixFilter::GetTransformParameterObject
ParameterObjectType * GetTransformParameterObject(void)
elastix::ElastixFilter::DataObjectContainerIterator
DataObjectContainerType::Iterator DataObjectContainerIterator
Definition: elxElastixFilter.h:63
elastix::ElastixFilter::DataObjectIdentifierType
itk::ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
Definition: elxElastixFilter.h:64
elastix::ElastixFilter::m_InitialTransformParameterFileName
std::string m_InitialTransformParameterFileName
Definition: elxElastixFilter.h:192
elastix::ElastixFilter::m_InputUID
unsigned int m_InputUID
Definition: elxElastixFilter.h:206
elastix::ElastixFilter::RemoveMovingPointSetFileName
void RemoveMovingPointSetFileName(void)
Definition: elxElastixFilter.h:142
elastix::ElastixFilter::RemoveInitialTransformParameterFileName
virtual void RemoveInitialTransformParameterFileName(void)
Definition: elxElastixFilter.h:132
elastix::ElastixFilter::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
elastix::ElastixFilter::NameArrayType
itk::ProcessObject::NameArray NameArrayType
Definition: elxElastixFilter.h:66
elastix::ElastixFilter::RemoveOutputDirectory
void RemoveOutputDirectory()
Definition: elxElastixFilter.h:147
elastix::ElastixFilter::AddFixedImage
virtual void AddFixedImage(TFixedImage *fixedImage)
elastix::ElastixFilter::m_NumberOfThreads
int m_NumberOfThreads
Definition: elxElastixFilter.h:204
elastix::ParameterObject
Definition: elxParameterObject.h:35
elastix::ElastixFilter::MovingImageConstPointer
TMovingImage::ConstPointer MovingImageConstPointer
Definition: elxElastixFilter.h:78
elastix::ElastixFilter::FixedMaskType
itk::Image< unsigned char, FixedImageDimension > FixedMaskType
Definition: elxElastixFilter.h:83
elastix::ElastixFilter::GenerateData
virtual void GenerateData(void) ITK_OVERRIDE
elastix::ElastixFilter::operator=
void operator=(const Self &)
elastix::ElastixFilter::ArgumentMapEntryType
ArgumentMapType::value_type ArgumentMapEntryType
Definition: elxElastixFilter.h:58
elastix::ElastixFilter::MovingMaskConstPointer
MovingMaskType::Pointer MovingMaskConstPointer
Definition: elxElastixFilter.h:88
elastix::ParameterObject::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition: elxParameterObject.h:46
elastix::ElastixFilter::Self
ElastixFilter Self
Definition: elxElastixFilter.h:41
elxPixelType.h
elastix::ElastixFilter::RemoveLogFileName
void RemoveLogFileName(void)
elastix::ElastixFilter::ElastixMainVectorType
std::vector< ElastixMainPointer > ElastixMainVectorType
Definition: elxElastixFilter.h:55
elastix::ElastixMain
A class with all functionality to configure elastix.
Definition: elxElastixMain.h:99
elastix::ElastixFilter::MakeUniqueName
std::string MakeUniqueName(const DataObjectIdentifierType &key)
elastix::ElastixFilter::GetFixedImage
FixedImageConstPointer GetFixedImage(void) const
elastix::ElastixFilter::GetMovingImage
MovingImageConstPointer GetMovingImage(const unsigned int index) const
elastix::ElastixMain::DataObjectContainerPointer
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
Definition: elxElastixMain.h:130
elastix::ParameterObject::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: elxParameterObject.h:40
elastix
Definition: elxFixedGenericPyramid.h:25
elastix::ParameterObject::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition: elxParameterObject.h:48
elastix::ElastixFilter::GetParameterObject
ParameterObjectType * GetParameterObject(void)
elastix::ElastixFilter::RemoveMovingMask
virtual void RemoveMovingMask(void)
elastix::ElastixFilter::MovingMaskType
itk::Image< unsigned char, MovingImageDimension > MovingMaskType
Definition: elxElastixFilter.h:86
elastix::ElastixFilter::GetNumberOfFixedMasks
unsigned int GetNumberOfFixedMasks(void) const
elastix::ParameterObject::Pointer
itk::SmartPointer< Self > Pointer
Definition: elxParameterObject.h:39


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo