00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBSplineResampleImageFunction.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/09/27 11:36:40 $ 00007 Version: $Revision: 1.9 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 Portions of this code are covered under the VTK copyright. 00013 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. 00014 00015 This software is distributed WITHOUT ANY WARRANTY; without even 00016 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 PURPOSE. See the above copyright notices for more information. 00018 00019 =========================================================================*/ 00020 00021 #ifndef __itkBSplineResampleImageFunction_h 00022 #define __itkBSplineResampleImageFunction_h 00023 00024 #include "itkBSplineInterpolateImageFunction.h" 00025 00026 namespace itk 00027 { 00047 template <class TImageType, class TCoordRep = float> 00048 class ITK_EXPORT BSplineResampleImageFunction : 00049 public BSplineInterpolateImageFunction< 00050 TImageType,TCoordRep,ITK_TYPENAME TImageType::PixelType > 00051 { 00052 public: 00054 typedef BSplineResampleImageFunction Self; 00055 typedef BSplineInterpolateImageFunction< 00056 TImageType,TCoordRep, ITK_TYPENAME TImageType::PixelType > Superclass; 00057 typedef SmartPointer<Self> Pointer; 00058 typedef SmartPointer<const Self> ConstPointer; 00059 00061 itkTypeMacro(BSplineResampleImageFunction, 00062 BSplineInterpolateImageFunction); 00063 00065 itkNewMacro( Self ); 00066 00068 virtual void SetInputImage(const TImageType * inputData) 00069 { 00070 // bypass my superclass 00071 this->InterpolateImageFunction<TImageType,TCoordRep>::SetInputImage(inputData); 00072 this->m_Coefficients = inputData; 00073 if ( this->m_Coefficients.IsNotNull() ) 00074 { 00075 this->m_DataLength = this->m_Coefficients->GetBufferedRegion().GetSize(); 00076 } 00077 } 00079 00080 protected: 00081 BSplineResampleImageFunction() {}; 00082 virtual ~BSplineResampleImageFunction() {}; 00083 void PrintSelf(std::ostream& os, Indent indent) const 00084 { 00085 this->Superclass::PrintSelf( os, indent ); 00086 } 00087 00088 private: 00089 BSplineResampleImageFunction(const Self&);//purposely not implemented 00090 }; 00091 00092 } // namespace itk 00093 00094 00095 #endif 00096 00097