go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkCUDAResampleImageFilter.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __itkCUDAResamplerImageFilter_h
15 #define __itkCUDAResamplerImageFilter_h
16 
17 #include "itkImage.h"
18 #include "itkResampleImageFilter.h"
21 #include "itkBSplineDeformableTransform.h"
22 #include "cudaResampleImageFilter.cuh"
23 
24 namespace itk
25 {
26 
39 template <typename TInputImage, typename TOutputImage, typename TInterpolatorPrecisionType = float>
40 class ITK_EXPORT itkCUDAResampleImageFilter:
41  public ResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecisionType>
42 {
43 public:
46  typedef ResampleImageFilter<
47  TInputImage,TOutputImage,TInterpolatorPrecisionType> Superclass;
48  typedef SmartPointer<Self> Pointer;
49  typedef SmartPointer<const Self> ConstPointer;
50 
52  itkNewMacro( Self );
53 
55  itkTypeMacro( itkCUDAResampleImageFilter, ResampleImageFilter );
56 
58  typedef typename Superclass::InputImageType InputImageType;
59  typedef typename Superclass::OutputImageType OutputImageType;
60  typedef typename Superclass::InputImagePointer InputImagePointer;
61  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
62  typedef typename Superclass::OutputImagePointer OutputImagePointer;
63  typedef typename Superclass::InputImageRegionType InputImageRegionType;
64 
65  typedef typename Superclass::TransformType TransformType;
66  typedef typename Superclass::TransformPointerType TransformPointerType;
67  typedef typename Superclass::InterpolatorType InterpolatorType;
68  typedef typename Superclass::InterpolatorPointerType InterpolatorPointerType;
69 
70  typedef typename Superclass::SizeType SizeType;
71  typedef typename Superclass::IndexType IndexType;
72  typedef typename Superclass::PointType PointType;
73  typedef typename Superclass::PixelType PixelType;
74  typedef typename Superclass::InputPixelType InputPixelType;
75  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
76  typedef typename Superclass::SpacingType SpacingType;
77  typedef typename Superclass::OriginPointType OriginPointType;
78  typedef typename Superclass::DirectionType DirectionType;
79  typedef typename Superclass::ImageBaseType ImageBaseType;
80 
83  TInterpolatorPrecisionType, 3 > InternalComboTransformType;
85  TInterpolatorPrecisionType, 3, 3 > InternalAdvancedBSplineTransformType;
88  typedef BSplineDeformableTransform<
89  TInterpolatorPrecisionType, 3, 3 > InternalBSplineTransformType;
90  typedef cuda::CUDAResampleImageFilter<
91  typename InternalBSplineTransformType::ParametersValueType,
92  typename TInputImage::PixelType, float > CudaResampleImageFilterType;
93 
95  itkSetMacro( UseCuda, bool );
96  itkGetConstMacro( UseCuda, bool );
97  itkBooleanMacro( UseCuda );
98 
100  itkSetMacro( UseGPUToCastData, bool );
101  itkGetConstMacro( UseGPUToCastData, bool );
102  itkBooleanMacro( UseGPUToCastData );
103 
105  itkSetMacro( UseFastCUDAKernel, bool );
106  itkGetConstMacro( UseFastCUDAKernel, bool );
107  itkBooleanMacro( UseFastCUDAKernel );
108 
110  virtual void GenerateData( void );
111 
114  {
115  public:
116  std::vector<std::string> m_Warnings;
117 
118  void ResetWarningReport( void )
119  {
120  this->m_Warnings.resize( 0 );
121  }
122  std::string GetWarningReportAsString( void ) const
123  {
124  std::string warnings = "\n---------------------------------\n";
125  for ( std::size_t i = 0; i < this->m_Warnings.size(); i++ )
126  {
127  warnings += "itkCUDAResampleImageFilter: " + this->m_Warnings[ i ];
128  warnings += "\n---------------------------------\n";
129  }
130  return warnings;
131  }
132  };
133  //itkGetConstReferenceMacro( WarningReport, WarningReportType );
134  virtual const WarningReportType & GetWarningReport( void ) const
135  {
136  return this->m_WarningReport;
137  }
138 
139 protected:
142 
143  virtual void CheckForValidConfiguration( ValidTransformPointer & bSplineTransform );
144 
145 private:
146 
148  bool m_UseCuda;
151 
153  WarningReportType m_WarningReport;
154 
159  bool CheckForValidTransform( ValidTransformPointer & bSplineTransform ) const;
160 
164  bool CheckForValidInterpolator( void ) const;
165 
169  bool CheckForValidDirectionCosines( ValidTransformPointer bSplineTransform ) ;//const;
170  // NOTE: const can be added again in ITK4. It's due to GetInput() being not const-correct.
171 
173  void CopyParameters( ValidTransformPointer bSplineTransform );
174 
175 }; // end class itkCUDAResampleImageFilter
176 
177 }; // end namespace itk
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkCUDAResampleImageFilter.hxx"
181 #endif
182 
183 #endif // end #ifndef __itkCUDAResamplerImageFilter_h
This class combines two transforms: an &#39;initial transform&#39; with a &#39;current transform&#39;.
Superclass::OutputImageType OutputImageType
Superclass::TransformPointerType TransformPointerType
Deformable transform using a B-spline representation.
Superclass::InterpolatorPointerType InterpolatorPointerType
Resample an image on the GPU via a coordinate transform.
Superclass::InputImageRegionType InputImageRegionType
BSplineDeformableTransform< TInterpolatorPrecisionType, 3, 3 > InternalBSplineTransformType
Superclass::InputImagePointer InputImagePointer
virtual const WarningReportType & GetWarningReport(void) const
CudaResampleImageFilterType m_CudaResampleImageFilter
InternalAdvancedBSplineTransformType::ConstPointer ValidTransformConstPointer
AdvancedCombinationTransform< TInterpolatorPrecisionType, 3 > InternalComboTransformType
InternalAdvancedBSplineTransformType::Pointer ValidTransformPointer
SmartPointer< const Self > ConstPointer
Superclass::OutputImagePointer OutputImagePointer
Superclass::InputImageType InputImageType
Superclass::InputImageConstPointer InputImageConstPointer
Superclass::OriginPointType OriginPointType
Superclass::OutputImageRegionType OutputImageRegionType
Superclass::InputPixelType InputPixelType
AdvancedBSplineDeformableTransform< TInterpolatorPrecisionType, 3, 3 > InternalAdvancedBSplineTransformType
Superclass::InterpolatorType InterpolatorType
cuda::CUDAResampleImageFilter< typename InternalBSplineTransformType::ParametersValueType, typename TInputImage::PixelType, float > CudaResampleImageFilterType
ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType > Superclass


Generated on 05-01-2014 for elastix by doxygen 1.8.5 elastix logo