00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkImageSpatialObject_h
00019 #define __itkImageSpatialObject_h
00020
00021 #include "itkRGBPixel.h"
00022 #include "itkImage.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkSpatialObject.h"
00025
00026 namespace itk
00027 {
00028
00038 template < unsigned int TDimension = 3,
00039 class PixelType = RGBPixel< char >
00040 >
00041 class ImageSpatialObject
00042 : public SpatialObject< TDimension >
00043 {
00044
00045 public:
00046
00047 typedef double ScalarType;
00048 typedef ImageSpatialObject< TDimension, PixelType > Self;
00049 typedef SpatialObject< TDimension > Superclass;
00050 typedef SmartPointer< Self > Pointer;
00051 typedef SmartPointer< const Self > ConstPointer;
00052
00053 typedef Image< PixelType, TDimension > ImageType;
00054 typedef typename ImageType::Pointer ImagePointer;
00055 typedef typename ImageType::IndexType IndexType;
00056 typedef typename ImageType::RegionType RegionType;
00057
00058 typedef typename Superclass::PointType PointType;
00059 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00060
00061 typedef VectorContainer< unsigned long, PointType> PointContainerType;
00062 typedef typename PointContainerType::Pointer PointContainerPointer;
00063
00065 itkNewMacro( Self );
00066
00068 itkTypeMacro( Self, Superclass );
00069
00071 void SetImage( ImageType * image );
00072
00074 ImageType * GetImage( void );
00075
00078 bool IsEvaluableAt( const PointType & point,
00079 unsigned int depth=0, char *name=NULL) const;
00080
00084 bool ValueAt( const PointType & point, double & value,
00085 unsigned int depth=0, char *name=NULL) const;
00086
00088 bool IsInside( const PointType & point,
00089 unsigned int depth=0, char *name=NULL) const;
00090
00092 bool ComputeBoundingBox( unsigned int depth=0, char *name=NULL);
00093
00095 unsigned long GetMTime( void ) const;
00096
00098 void SetSlicePosition(unsigned int dimension, int position);
00099
00101 int GetSlicePosition(unsigned int dimension)
00102 {return m_SlicePosition[dimension];}
00103
00104 protected:
00105
00106 ImagePointer m_Image;
00107
00108 ImageSpatialObject();
00109 virtual ~ImageSpatialObject();
00110
00111 void PrintSelf( std::ostream& os, Indent indent ) const;
00112
00113 int* m_SlicePosition;
00114 };
00115
00116 }
00117
00118 #ifndef ITK_MANUAL_INSTANTIATION
00119 #include "itkImageSpatialObject.txx"
00120 #endif
00121
00122 #endif //__itkImageSpatialObject_h