Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImageSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/01/28 19:24:38 $
00007   Version:   $Revision: 1.28 $
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      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkImageSpatialObject_h
00019 #define __itkImageSpatialObject_h
00020 
00021 #include "itkImage.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkSpatialObject.h"
00024 #include "itkInterpolateImageFunction.h"
00025 #include "itkNearestNeighborInterpolateImageFunction.h"
00026 
00027 namespace itk
00028 {
00029   
00039 template < unsigned int TDimension = 3,
00040            class TPixelType = unsigned char
00041 >
00042 class ImageSpatialObject 
00043   : public SpatialObject< TDimension >
00044 {
00045 
00046 public:
00047  
00048   typedef double ScalarType; 
00049   typedef ImageSpatialObject< TDimension, TPixelType > Self;
00050   typedef SpatialObject< TDimension >                 Superclass;
00051   typedef SmartPointer< Self >                        Pointer;
00052   typedef SmartPointer< const Self >                  ConstPointer;
00053 
00054   typedef TPixelType                            PixelType;
00055   typedef Image< PixelType, TDimension >        ImageType;
00056   typedef typename ImageType::ConstPointer      ImagePointer;
00057   typedef typename ImageType::IndexType         IndexType;
00058   typedef typename ImageType::RegionType        RegionType;
00059   typedef typename Superclass::TransformType    TransformType;
00060   typedef typename Superclass::PointType        PointType;
00061   typedef typename Superclass::BoundingBoxType  BoundingBoxType;
00062   typedef InterpolateImageFunction<ImageType>   InterpolatorType;
00063 
00064   typedef NearestNeighborInterpolateImageFunction<ImageType>  
00065                                                 NNInterpolatorType;
00066 
00067   typedef VectorContainer< unsigned long, PointType> PointContainerType;
00068   typedef typename PointContainerType::Pointer       PointContainerPointer;
00069 
00071   itkNewMacro( Self );
00072 
00074   itkTypeMacro( ImageSpatialObject, SpatialObject );
00075 
00077   void SetImage( const ImageType * image );
00078 
00080   const ImageType * GetImage( void ) const;
00081 
00084   bool IsEvaluableAt( const PointType & point, 
00085                       unsigned int depth=0, char *name=NULL) const;
00086 
00090   bool ValueAt( const PointType & point, double & value, 
00091                 unsigned int depth=0, char *name=NULL) const;
00092 
00093 
00095   bool IsInside( const PointType & point,
00096                  unsigned int depth, char *name) const;
00097 
00101   bool IsInside( const PointType & point) const;
00102 
00104   bool ComputeLocalBoundingBox() const;
00105 
00107   unsigned long GetMTime( void ) const;
00108 
00110   void SetSlicePosition(unsigned int dimension, int position);
00111 
00113   int GetSlicePosition(unsigned int dimension) 
00114   {return m_SlicePosition[dimension];}
00115 
00116   const char* GetPixelType()
00117     {
00118     return m_PixelType.c_str();
00119     }
00120 
00122   void SetInterpolator(InterpolatorType * interpolator);
00123   itkGetObjectMacro(Interpolator,InterpolatorType);
00125 
00126 protected:
00127   ImageSpatialObject(const Self&); //purposely not implemented
00128   void operator=(const Self&); //purposely not implemented
00129 
00130   ImagePointer m_Image;
00131 
00132   ImageSpatialObject();
00133   virtual ~ImageSpatialObject();
00134 
00135   void PrintSelf( std::ostream& os, Indent indent ) const;
00136 
00137   int*        m_SlicePosition;
00138   std::string m_PixelType;
00139 
00140   typename InterpolatorType::Pointer m_Interpolator;
00141 };
00142 
00143 } // end of namespace itk
00144 
00145 #ifndef ITK_MANUAL_INSTANTIATION
00146 #include "itkImageSpatialObject.txx"
00147 #endif
00148 
00149 #endif //__itkImageSpatialObject_h
00150 

Generated at Sun Sep 23 13:09:36 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000