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.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 #ifndef __itkCUDAResamplerImageFilter_h
00015 #define __itkCUDAResamplerImageFilter_h
00016 
00017 #include "itkImage.h"
00018 #include "itkResampleImageFilter.h"
00019 #include "itkAdvancedCombinationTransform.h"
00020 #include "itkAdvancedBSplineDeformableTransform.h"
00021 #include "itkBSplineDeformableTransform.h"
00022 #include "cudaResampleImageFilter.cuh"
00023 
00024 namespace itk
00025 {
00026 
00039 template <typename TInputImage, typename TOutputImage, typename TInterpolatorPrecisionType = float>
00040 class ITK_EXPORT itkCUDAResampleImageFilter:
00041   public ResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecisionType>
00042 {
00043 public:
00045   typedef itkCUDAResampleImageFilter                          Self;
00046   typedef ResampleImageFilter<
00047     TInputImage,TOutputImage,TInterpolatorPrecisionType>      Superclass;
00048   typedef SmartPointer<Self>                                  Pointer;
00049   typedef SmartPointer<const Self>                            ConstPointer;
00050 
00052   itkNewMacro( Self );
00053 
00055   itkTypeMacro( itkCUDAResampleImageFilter, ResampleImageFilter );
00056 
00058   typedef typename Superclass::InputImageType           InputImageType;
00059   typedef typename Superclass::OutputImageType          OutputImageType;
00060   typedef typename Superclass::InputImagePointer        InputImagePointer;
00061   typedef typename Superclass::InputImageConstPointer   InputImageConstPointer;
00062   typedef typename Superclass::OutputImagePointer       OutputImagePointer;
00063   typedef typename Superclass::InputImageRegionType     InputImageRegionType;
00064 
00065   typedef typename Superclass::TransformType            TransformType;
00066   typedef typename Superclass::TransformPointerType     TransformPointerType;
00067   typedef typename Superclass::InterpolatorType         InterpolatorType;
00068   typedef typename Superclass::InterpolatorPointerType  InterpolatorPointerType;
00069 
00070   typedef typename Superclass::SizeType                 SizeType;
00071   typedef typename Superclass::IndexType                IndexType;
00072   typedef typename Superclass::PointType                PointType;
00073   typedef typename Superclass::PixelType                PixelType;
00074   typedef typename Superclass::InputPixelType           InputPixelType;
00075   typedef typename Superclass::OutputImageRegionType    OutputImageRegionType;
00076   typedef typename Superclass::SpacingType              SpacingType;
00077   typedef typename Superclass::OriginPointType          OriginPointType;
00078   typedef typename Superclass::DirectionType            DirectionType;
00079   typedef typename Superclass::ImageBaseType            ImageBaseType;
00080 
00082   typedef AdvancedCombinationTransform<
00083     TInterpolatorPrecisionType, 3 >                     InternalComboTransformType;
00084   typedef AdvancedBSplineDeformableTransform<
00085     TInterpolatorPrecisionType, 3, 3 >                  InternalAdvancedBSplineTransformType;
00086   typedef typename InternalAdvancedBSplineTransformType::Pointer ValidTransformPointer;
00087   typedef BSplineDeformableTransform<
00088     TInterpolatorPrecisionType, 3, 3 >                  InternalBSplineTransformType;
00089   typedef cuda::CUDAResampleImageFilter<
00090     typename InternalBSplineTransformType::ParametersValueType,
00091     typename TInputImage::PixelType, float >            CudaResampleImageFilterType;
00092 
00094   itkSetMacro( UseCuda, bool );
00095   itkGetConstMacro( UseCuda, bool );
00096   itkBooleanMacro( UseCuda );
00097 
00099   itkSetMacro( UseGPUToCastData, bool );
00100   itkGetConstMacro( UseGPUToCastData, bool );
00101   itkBooleanMacro( UseGPUToCastData );
00102 
00104   virtual void GenerateData( void );
00105 
00106 protected:
00107   itkCUDAResampleImageFilter();
00108   ~itkCUDAResampleImageFilter();
00109 
00110 private:
00111 
00113   bool      m_UseCuda;
00114   bool      m_UseGPUToCastData;
00115   CudaResampleImageFilterType m_CudaResampleImageFilter;
00116 
00121   bool CheckForValidTransform( ValidTransformPointer & bSplineTransform ) const;
00122 
00124   void CopyParameters( ValidTransformPointer bSplineTransform );
00125 };
00126 
00127 }; /* namespace itk */
00128 
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkCUDAResampleImageFilter.hxx"
00131 #endif
00132 
00133 #endif // end #ifndef __itkCUDAResamplerImageFilter_h


Generated on 11-05-2011 for elastix by doxygen 1.7.4 elastix logo