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 );
93  FixedImageConstPointer GetFixedImage( void ) const;
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 );
100  MovingImageConstPointer GetMovingImage( void ) const;
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 );
107  FixedMaskConstPointer GetFixedMask( void ) const;
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 );
115  MovingMaskConstPointer GetMovingMask( void ) const;
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 );
122  ParameterObjectType * GetParameterObject( void );
123  const ParameterObjectType * GetParameterObject( void ) const;
124 
126  ParameterObjectType * GetTransformParameterObject( void );
127  const ParameterObjectType * GetTransformParameterObject( void ) const;
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 
194  std::string m_InitialTransformParameterFileName;
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
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
DataObjectContainerType::Iterator DataObjectContainerIterator
itk::ImageSource< TFixedImage > Superclass
TMovingImage::ConstPointer MovingImageConstPointer
ElastixMainType::ObjectPointer ElastixMainObjectPointer
itk::Image< unsigned char, FixedImageDimension > FixedMaskType
ElastixMainType::FlatDirectionCosinesType FlatDirectionCosinesType
itk::SmartPointer< const Self > ConstPointer
ArgumentMapType::value_type ArgumentMapEntryType
ParameterObjectType::ParameterValueVectorType ParameterValueVectorType
std::vector< ElastixMainPointer > ElastixMainVectorType
ElastixBase::DataObjectContainerType DataObjectContainerType
elastix::ElastixMain ElastixMainType
TFixedImage::ConstPointer FixedImageConstPointer
itk::SmartPointer< Self > Pointer
itk::ProcessObject::DataObjectIdentifierType DataObjectIdentifierType
void RemoveMovingPointSetFileName(void)
virtual void RemoveInitialTransformParameterFileName(void)
itk::Image< unsigned char, MovingImageDimension > MovingMaskType
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
ConfigurationType::CommandLineArgumentMapType ArgumentMapType
std::string m_MovingPointSetFileName
itk::ProcessObject::NameArray NameArrayType
ElastixMainType::DataObjectContainerPointer DataObjectContainerPointer
MovingMaskType::Pointer MovingMaskConstPointer
TFixedImage::Pointer FixedImagePointer
ElastixMainType::Pointer ElastixMainPointer
ElastixMainType::ArgumentMapType ArgumentMapType
ObjectType::Pointer ObjectPointer
A class with all functionality to configure elastix.
ParameterObjectType::ParameterMapVectorType ParameterMapVectorType
ElastixMainType::DataObjectContainerType DataObjectContainerType
FixedMaskType::Pointer FixedMaskPointer
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
std::string m_FixedPointSetFileName
MovingMaskType::Pointer MovingMaskPointer
ParameterObjectType::ConstPointer ParameterObjectConstPointer
ParameterObjectType::Pointer ParameterObjectPointer
FixedMaskType::Pointer FixedMaskConstPointer
virtual void VerifyInputInformation(void) ITK_OVERRIDE
itk::SmartPointer< Self > Pointer
TMovingImage::Pointer MovingImagePointer
std::vector< ParameterValueType > ParameterValueVectorType
ParameterObjectType::ParameterMapType ParameterMapType
void RemoveFixedPointSetFileName(void)
ParameterObject ParameterObjectType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
#define ELASTIXLIB_API
Definition: elxMacro.h:301
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
std::vector< ParameterMapType > ParameterMapVectorType


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo