ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRayCastInterpolateImageFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRayCastInterpolateImageFunction_h
00019 #define __itkRayCastInterpolateImageFunction_h
00020 
00021 #include "itkInterpolateImageFunction.h"
00022 #include "itkTransform.h"
00023 
00024 namespace itk
00025 {
00038 template< class TInputImage, class TCoordRep = double >
00039 class ITK_EXPORT RayCastInterpolateImageFunction:
00040   public InterpolateImageFunction< TInputImage, TCoordRep >
00041 {
00042 public:
00044   typedef RayCastInterpolateImageFunction                    Self;
00045   typedef InterpolateImageFunction< TInputImage, TCoordRep > Superclass;
00046   typedef SmartPointer< Self >                               Pointer;
00047   typedef SmartPointer< const Self >                         ConstPointer;
00048 
00050   itkStaticConstMacro(InputImageDimension, unsigned int,
00051                       TInputImage::ImageDimension);
00052 
00057   typedef Transform< TCoordRep, 3, 3 > TransformType;
00058 
00059   typedef typename TransformType::Pointer         TransformPointer;
00060   typedef typename TransformType::InputPointType  InputPointType;
00061   typedef typename TransformType::OutputPointType OutputPointType;
00062   typedef typename TransformType::ParametersType  TransformParametersType;
00063   typedef typename TransformType::JacobianType    TransformJacobianType;
00064 
00065   typedef typename Superclass::InputPixelType PixelType;
00066 
00067   typedef typename TInputImage::SizeType SizeType;
00068 
00069   typedef Vector< TCoordRep, 3 > DirectionType;
00070 
00072   typedef InterpolateImageFunction< TInputImage, TCoordRep > InterpolatorType;
00073 
00074   typedef typename InterpolatorType::Pointer InterpolatorPointer;
00075 
00077   itkTypeMacro(RayCastInterpolateImageFunction, InterpolateImageFunction);
00078 
00080   itkNewMacro(Self);
00081 
00083   typedef typename Superclass::OutputType OutputType;
00084 
00086   typedef typename Superclass::InputImageType InputImageType;
00087 
00089   typedef typename Superclass::RealType RealType;
00090 
00092   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00093 
00095   typedef typename Superclass::PointType PointType;
00096 
00098   typedef typename Superclass::IndexType IndexType;
00099 
00101   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00102 
00113   virtual OutputType Evaluate(const PointType & point) const;
00114 
00126   virtual OutputType EvaluateAtContinuousIndex(
00127     const ContinuousIndexType & index) const;
00128 
00130   itkSetObjectMacro(Transform, TransformType);
00131 
00133   itkGetObjectMacro(Transform, TransformType);
00134 
00136   itkSetObjectMacro(Interpolator, InterpolatorType);
00137 
00139   itkGetObjectMacro(Interpolator, InterpolatorType);
00140 
00142   itkSetMacro(FocalPoint, InputPointType);
00143 
00145   itkGetConstMacro(FocalPoint, InputPointType);
00146 
00148   itkSetMacro(Threshold, double);
00149 
00151   itkGetConstMacro(Threshold, double);
00152 
00156   inline bool IsInsideBuffer(const PointType &) const
00157   {
00158     return true;
00159   }
00160 
00161   bool IsInsideBuffer(const ContinuousIndexType &) const
00162   {
00163     return true;
00164   }
00165 
00166   bool IsInsideBuffer(const IndexType &) const
00167   {
00168     return true;
00169   }
00170 
00171 protected:
00172 
00174   RayCastInterpolateImageFunction();
00175 
00177   ~RayCastInterpolateImageFunction(){}
00178 
00180   void PrintSelf(std::ostream & os, Indent indent) const;
00181 
00183   TransformPointer m_Transform;
00184 
00186   InputPointType m_FocalPoint;
00187 
00189   double m_Threshold;
00190 
00192   InterpolatorPointer m_Interpolator;
00193 private:
00194   RayCastInterpolateImageFunction(const Self &); //purposely not implemented
00195   void operator=(const Self &);                  //purposely not implemented
00196 };
00197 } // namespace itk
00198 
00199 #ifndef ITK_MANUAL_INSTANTIATION
00200 #include "itkRayCastInterpolateImageFunction.hxx"
00201 #endif
00202 
00203 #endif
00204