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 namespace elastix
29 {
72 template< class TElastix >
73 class ResamplerBase : public BaseComponentSE< TElastix >
74 {
75 public:
76 
80 
82  itkTypeMacro( ResamplerBase, BaseComponentSE );
83 
91 
94  typedef typename ElastixType::MovingImageType InputImageType;
95  typedef typename ElastixType::MovingImageType OutputImageType;
96  //typedef typename ElastixType::FixedImageType OutputImageType;
97  typedef typename ElastixType::CoordRepType CoordRepType;
98 
100  typedef itk::ResampleImageFilter<
102 
104  typedef typename ITKBaseType::TransformType TransformType;
105  typedef typename ITKBaseType::InterpolatorType InterpolatorType;
106  typedef typename ITKBaseType::SizeType SizeType;
107  typedef typename ITKBaseType::IndexType IndexType;
108  typedef typename ITKBaseType::SpacingType SpacingType;
109  typedef typename ITKBaseType::DirectionType DirectionType;
110  typedef typename ITKBaseType::OriginPointType OriginPointType;
111  typedef typename ITKBaseType::PixelType OutputPixelType;
112 
114  typedef typename ElastixType::ParameterMapType ParameterMapType;
115 
118 
120  itkStaticConstMacro( ImageDimension, unsigned int,
121  OutputImageType::ImageDimension );
122 
124  virtual ITKBaseType * GetAsITKBaseType( void )
125  {
126  return dynamic_cast< ITKBaseType * >( this );
127  }
128 
129 
131  virtual const ITKBaseType * GetAsITKBaseType( void ) const
132  {
133  return dynamic_cast< const ITKBaseType * >( this );
134  }
135 
136 
140  virtual int BeforeAllTransformix( void ){ return 0; }
141 
148  void BeforeRegistrationBase( void ) override;
149 
153  void AfterEachResolutionBase( void ) override;
154 
158  void AfterEachIterationBase( void ) override;
159 
163  void AfterRegistrationBase( void ) override;
164 
166  virtual void ReadFromFile( void );
167 
169  virtual void WriteToFile( void ) const;
170 
172  virtual void CreateTransformParametersMap( ParameterMapType * paramsMap ) const;
173 
175  virtual void ResampleAndWriteResultImage( const char * filename, const bool & showProgress = true );
176 
178  virtual void WriteResultImage( OutputImageType * imageimage,
179  const char * filename, const bool & showProgress = true );
180 
182  virtual void CreateItkResultImage( void );
183 
184 protected:
185 
189  ~ResamplerBase() override {}
190 
192  virtual void SetComponents( void );
193 
196 
197 private:
198 
200  ResamplerBase( const Self & ); // purposely not implemented
202  void operator=( const Self & ); // purposely not implemented
203 
205  void ReleaseMemory( void );
206 
207 };
208 
209 } // end namespace elastix
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "elxResamplerBase.hxx"
213 #endif
214 
215 #endif // end #ifndef __elxResamplerBase_h
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
Configuration::Pointer ConfigurationPointer
itk::WeakPointer< ElastixType > ElastixPointer
RegistrationType * RegistrationPointer
ElastixType::RegistrationBaseType RegistrationType
A class that deals with user given parameters and command line arguments.
A specialized Command object for updating the progress of a filter.
itk::ResampleImageFilter< InputImageType, OutputImageType, CoordRepType > ITKBaseType
ITKBaseType::SpacingType SpacingType
ITKBaseType::SizeType SizeType
virtual void CreateTransformParametersMap(ParameterMapType *paramsMap) const
Superclass::ConfigurationPointer ConfigurationPointer
Superclass::ConfigurationType ConfigurationType
elx::ProgressCommand ProgressCommandType
ElastixType::ParameterMapType ParameterMapType
virtual void CreateItkResultImage(void)
ElastixType::CoordRepType CoordRepType
Superclass::ElastixPointer ElastixPointer
virtual void WriteResultImage(OutputImageType *imageimage, const char *filename, const bool &showProgress=true)
void operator=(const Self &)
Superclass::RegistrationType RegistrationType
ITKBaseType::InterpolatorType InterpolatorType
ElastixType::MovingImageType InputImageType
itkStaticConstMacro(ImageDimension, unsigned int, OutputImageType::ImageDimension)
void AfterRegistrationBase(void) override
virtual void ResampleAndWriteResultImage(const char *filename, const bool &showProgress=true)
virtual int BeforeAllTransformix(void)
virtual ITKBaseType * GetAsITKBaseType(void)
void AfterEachResolutionBase(void) override
ITKBaseType::IndexType IndexType
ITKBaseType::DirectionType DirectionType
void AfterEachIterationBase(void) override
ITKBaseType::TransformType TransformType
BaseComponentSE< TElastix > Superclass
virtual void WriteToFile(void) const
void BeforeRegistrationBase(void) override
ResamplerBase(const Self &)
virtual const ITKBaseType * GetAsITKBaseType(void) const
virtual void SetComponents(void)
ElastixType::MovingImageType OutputImageType
ITKBaseType::OriginPointType OriginPointType
Superclass::RegistrationPointer RegistrationPointer
virtual void ReadFromFile(void)
ITKBaseType::PixelType OutputPixelType
Superclass::ElastixType ElastixType


Generated on 1652341256 for elastix by doxygen 1.9.1 elastix logo