go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxResamplerBase.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 __elxResamplerBase_h
19 #define __elxResamplerBase_h
20 
22 #include "elxMacro.h"
23 
24 #include "elxBaseComponentSE.h"
25 #include "itkResampleImageFilter.h"
26 #include "elxProgressCommand.h"
27 
28 
29 namespace elastix
30 {
73 template< class TElastix >
74 class ResamplerBase : public BaseComponentSE< TElastix >
75 {
76 public:
77 
81 
83  itkTypeMacro( ResamplerBase, BaseComponentSE );
84 
86  typedef typename Superclass::ElastixType ElastixType;
92 
95  typedef typename ElastixType::MovingImageType InputImageType;
96  typedef typename ElastixType::MovingImageType OutputImageType;
97  //typedef typename ElastixType::FixedImageType OutputImageType;
98  typedef typename ElastixType::CoordRepType CoordRepType;
99 
101  typedef itk::ResampleImageFilter<
103 
105  typedef typename ITKBaseType::TransformType TransformType;
106  typedef typename ITKBaseType::InterpolatorType InterpolatorType;
107  typedef typename ITKBaseType::SizeType SizeType;
108  typedef typename ITKBaseType::IndexType IndexType;
109  typedef typename ITKBaseType::SpacingType SpacingType;
110  typedef typename ITKBaseType::DirectionType DirectionType;
111  typedef typename ITKBaseType::OriginPointType OriginPointType;
112  typedef typename ITKBaseType::PixelType OutputPixelType;
113 
115  typedef typename ElastixType::ParameterMapType ParameterMapType;
116 
119 
121  itkStaticConstMacro( ImageDimension, unsigned int,
122  OutputImageType::ImageDimension );
123 
125  virtual ITKBaseType * GetAsITKBaseType( void )
126  {
127  return dynamic_cast< ITKBaseType * >( this );
128  }
129 
130 
132  virtual const ITKBaseType * GetAsITKBaseType( void ) const
133  {
134  return dynamic_cast< const ITKBaseType * >( this );
135  }
136 
137 
141  virtual int BeforeAllTransformix( void ){ return 0; }
142 
149  virtual void BeforeRegistrationBase( void );
150 
154  virtual void AfterEachResolutionBase( void );
155 
159  virtual void AfterEachIterationBase( void );
160 
164  virtual void AfterRegistrationBase( void );
165 
167  virtual void ReadFromFile( void );
168 
170  virtual void WriteToFile( void ) const;
171 
173  virtual void CreateTransformParametersMap( ParameterMapType * paramsMap ) const;
174 
176  virtual void ResampleAndWriteResultImage( const char * filename, const bool & showProgress = true );
177 
179  virtual void WriteResultImage( OutputImageType *imageimage,
180  const char * filename, const bool & showProgress = true );
181 
183  virtual void CreateItkResultImage( void );
184 
185 protected:
186 
188  ResamplerBase();
190  virtual ~ResamplerBase() {}
191 
193  virtual void SetComponents( void );
194 
197 
198 private:
199 
201  ResamplerBase( const Self & ); // purposely not implemented
203  void operator=( const Self & ); // purposely not implemented
204 
206  void ReleaseMemory( void );
207 
208 };
209 
210 } // end namespace elastix
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "elxResamplerBase.hxx"
214 #endif
215 
216 #endif // end #ifndef __elxResamplerBase_h
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
virtual void ResampleAndWriteResultImage(const char *filename, const bool &showProgress=true)
ElastixType::RegistrationBaseType RegistrationType
ElastixType::ConfigurationPointer ConfigurationPointer
ElastixType::Pointer ElastixPointer
ElastixType::ConfigurationType ConfigurationType
Superclass::ElastixPointer ElastixPointer
virtual int BeforeAllTransformix(void)
virtual void WriteToFile(void) const
ElastixType::CoordRepType CoordRepType
void operator=(const Self &)
Superclass::RegistrationType RegistrationType
ITKBaseType::InterpolatorType InterpolatorType
ElastixType::MovingImageType InputImageType
virtual void AfterEachIterationBase(void)
virtual void ReadFromFile(void)
ElastixType::MovingImageType OutputImageType
Superclass::ElastixType ElastixType
Superclass::RegistrationPointer RegistrationPointer
RegistrationType * RegistrationPointer
virtual void CreateItkResultImage(void)
Superclass::ConfigurationType ConfigurationType
itkStaticConstMacro(ImageDimension, unsigned int, OutputImageType::ImageDimension)
BaseComponentSE< TElastix > Superclass
ITKBaseType::SpacingType SpacingType
ITKBaseType::DirectionType DirectionType
virtual void AfterRegistrationBase(void)
ElastixType::ParameterMapType ParameterMapType
virtual void BeforeRegistrationBase(void)
virtual void AfterEachResolutionBase(void)
virtual const ITKBaseType * GetAsITKBaseType(void) const
ITKBaseType::OriginPointType OriginPointType
ITKBaseType::IndexType IndexType
virtual void SetComponents(void)
itk::ResampleImageFilter< InputImageType, OutputImageType, CoordRepType > ITKBaseType
virtual ITKBaseType * GetAsITKBaseType(void)
elx::ProgressCommand ProgressCommandType
A specialized Command object for updating the progress of a filter.
Superclass::ConfigurationPointer ConfigurationPointer
ITKBaseType::SizeType SizeType
ITKBaseType::TransformType TransformType
virtual void WriteResultImage(OutputImageType *imageimage, const char *filename, const bool &showProgress=true)
virtual void CreateTransformParametersMap(ParameterMapType *paramsMap) const
ITKBaseType::PixelType OutputPixelType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo