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 NDimensions = 3,
00039 class TransformType = AffineTransform< double,
00040 NDimensions>,
00041 class PixelType = RGBPixel< char > ,
00042 unsigned int PipelineDimension = 3
00043 >
00044 class ImageSpatialObject
00045 : public SpatialObject< NDimensions, TransformType , PipelineDimension >
00046 {
00047
00048 public:
00049
00050 typedef double ScalarType;
00051 typedef ImageSpatialObject< NDimensions, TransformType, PixelType , PipelineDimension > Self;
00052 typedef SpatialObject< NDimensions, TransformType > Superclass;
00053 typedef SmartPointer< Self > Pointer;
00054 typedef SmartPointer< const Self > ConstPointer;
00055
00056 typedef Image< PixelType, NDimensions > ImageType;
00057 typedef typename ImageType::Pointer ImagePointer;
00058 typedef typename ImageType::IndexType IndexType;
00059 typedef typename ImageType::RegionType RegionType;
00060
00061 typedef typename Superclass::PointType PointType;
00062 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00063
00064 typedef VectorContainer< unsigned long, PointType> PointContainerType;
00065 typedef typename PointContainerType::Pointer PointContainerPointer;
00066
00068 itkNewMacro( Self );
00069
00071 itkTypeMacro( Self, Superclass );
00072
00074 void SetImage( ImageType * image );
00075
00077 ImageType * GetImage( void );
00078
00081 bool IsEvaluableAt( const PointType & point );
00082
00086 void ValueAt( const PointType & point, double & value );
00087
00089 bool IsInside( const PointType & point );
00090
00092 void ComputeBounds( void );
00093
00095 unsigned long GetMTime( void ) const;
00096
00098 void SetSlicePosition(unsigned int dimension, int position) {m_SlicePosition[dimension]=position;}
00099
00101 int GetSlicePosition(unsigned int dimension) {return m_SlicePosition[dimension];}
00102
00103 protected:
00104
00105 ImagePointer m_Image;
00106
00107 ImageSpatialObject();
00108 virtual ~ImageSpatialObject();
00109
00110 void PrintSelf( std::ostream& os, Indent indent ) const;
00111
00112 int* m_SlicePosition;
00113 };
00114
00115 }
00116
00117 #ifndef ITK_MANUAL_INSTANTIATION
00118 #include "itkImageSpatialObject.txx"
00119 #endif
00120
00121 #endif //__itkImageSpatialObject_h