go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxOpenCLResampler.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 __elxOpenCLResampler_h
19 #define __elxOpenCLResampler_h
20 
21 #include "elxIncludes.h" // include first to avoid MSVS warning
22 #include "elxOpenCLSupportedImageTypes.h"
23 
27 
28 namespace elastix
29 {
30 
49 template< class TElastix >
51  public itk::ResampleImageFilter<
52  typename ResamplerBase< TElastix >::InputImageType,
53  typename ResamplerBase< TElastix >::OutputImageType,
54  typename ResamplerBase< TElastix >::CoordRepType >,
55  public ResamplerBase< TElastix >
56 {
57 public:
58 
61 
62  typedef itk::ResampleImageFilter<
67  typedef itk::SmartPointer< Self > Pointer;
68  typedef itk::SmartPointer< const Self > ConstPointer;
69 
71  itkNewMacro( Self );
72 
74  itkTypeMacro( OpenCLResampler, ResampleImageFilter );
75 
80  elxClassNameMacro( "OpenCLResampler" );
81 
83  typedef typename Superclass1::InterpolatorType InterpolatorType;
84  typedef typename Superclass1::TransformType TransformType;
85 
86  typedef typename Superclass1::InputImageType InputImageType;
87  typedef typename InputImageType::PixelType InputImagePixelType;
88 
89  typedef typename Superclass1::OutputImageType OutputImageType;
90  typedef typename OutputImageType::PixelType OutputImagePixelType;
91  typedef typename OutputImageType::RegionType OutputImageRegionType;
92 
100 
104  GPUInterpolatorPrecisionType > GPUResamplerType;
106 
108  virtual void SetTransform( const TransformType * _arg );
109 
111  virtual void SetInterpolator( InterpolatorType * _arg );
112 
114  virtual void BeforeRegistration( void );
115 
117  virtual void ReadFromFile( void );
118 
120  virtual void WriteToFile( void ) const;
121 
122 protected:
123 
125  OpenCLResampler();
127  virtual ~OpenCLResampler() {}
128 
130  void BeforeGenerateData( void );
131 
133  virtual void GenerateData( void );
134 
140  OpenCLImageTypes, OpenCLImageDimentions, AdvancedCombinationTransformType, float >
144 
146  typedef typename InterpolatorType::InputImageType InterpolatorInputImageType;
147  typedef typename InterpolatorType::CoordRepType InterpolatorCoordRepType;
148  typedef itk::InterpolateImageFunction< InterpolatorInputImageType, InterpolatorCoordRepType >
150  typedef typename itk::GPUInterpolatorCopier<
151  OpenCLImageTypes, OpenCLImageDimentions, InterpolateImageFunctionType, float >
155 
156 private:
157 
159  OpenCLResampler( const Self & ); // purposely not implemented
161  void operator=( const Self & ); // purposely not implemented
162 
164  void SwitchingToCPUAndReport( const bool configError );
165 
166  TransformCopierPointer m_TransformCopier;
167  InterpolateCopierPointer m_InterpolatorCopier;
168  GPUResamplerPointer m_GPUResampler;
173 };
174 
175 // end class OpenCLResampler
176 
177 } // end namespace elastix
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "elxOpenCLResampler.hxx"
181 #endif
182 
183 #endif // end #ifndef __elxOpenCLResampler_h
This class combines two transforms: an 'initial transform' with a 'current transform'.
itk::SmartPointer< Self > Pointer
itk::GPUImage< InputImagePixelType, InputImageType::ImageDimension > GPUInputImageType
virtual void BeforeRegistration(void)
ResamplerBase< TElastix >::CoordRepType InterpolatorPrecisionType
virtual void SetTransform(const TransformType *_arg)
void operator=(const Self &)
itk::GPUAdvancedCombinationTransformCopier< OpenCLImageTypes, OpenCLImageDimentions, AdvancedCombinationTransformType, float > TransformCopierType
InterpolateCopierPointer m_InterpolatorCopier
TransformCopierType::Pointer TransformCopierPointer
GPUExplicitInterpolatorType::Pointer GPUExplicitInterpolatorPointer
elxClassNameMacro("OpenCLResampler")
itk::GPUImage< OutputImagePixelType, OutputImageType::ImageDimension > GPUOutputImageType
ElastixType::CoordRepType CoordRepType
GPUResamplerType::Pointer GPUResamplerPointer
Superclass1::InterpolatorType InterpolatorType
virtual void SetInterpolator(InterpolatorType *_arg)
ElastixType::MovingImageType InputImageType
ElastixType::MovingImageType OutputImageType
itk::SmartPointer< const Self > ConstPointer
A helper class which creates an GPU interpolator which is perfect copy of the CPU interpolator...
A resampler based on the itk::GPUResampleImageFilter. The parameters used in this class are: ...
virtual void ReadFromFile(void)
GPU version of ResampleImageFilter.
Templated n-dimensional image class for the GPU.
Definition: itkGPUImage.h:63
A helper class which creates an GPU AdvancedCombinationTransform which is perfect copy of the CPU Adv...
itk::AdvancedCombinationTransform< InterpolatorPrecisionType, OutputImageType::ImageDimension > AdvancedCombinationTransformType
ResamplerBase< TElastix > Superclass2
Superclass1::OutputImageType OutputImageType
TransformCopierType::GPUComboTransformPointer GPUTransformPointer
itk::ResampleImageFilter< typename ResamplerBase< TElastix >::InputImageType, typename ResamplerBase< TElastix >::OutputImageType, typename ResamplerBase< TElastix >::CoordRepType > Superclass1
InterpolateCopierType::Pointer InterpolateCopierPointer
GPUResamplerPointer m_GPUResampler
itk::GPUResampleImageFilter< GPUInputImageType, GPUOutputImageType, GPUInterpolatorPrecisionType > GPUResamplerType
InterpolatorType::CoordRepType InterpolatorCoordRepType
InterpolateCopierType::GPUExplicitInterpolatorPointer GPUExplicitInterpolatorPointer
virtual void GenerateData(void)
GPUInputImageType::Pointer GPUInputImagePointer
InterpolatorType::InputImageType InterpolatorInputImageType
virtual void WriteToFile(void) const
Superclass1::InputImageType InputImageType
TransformCopierPointer m_TransformCopier
itk::InterpolateImageFunction< InterpolatorInputImageType, InterpolatorCoordRepType > InterpolateImageFunctionType
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputImagePixelType
void SwitchingToCPUAndReport(const bool configError)
Superclass1::TransformType TransformType
InputImageType::PixelType InputImagePixelType
itk::GPUInterpolatorCopier< OpenCLImageTypes, OpenCLImageDimentions, InterpolateImageFunctionType, float > InterpolateCopierType


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