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 typedef typename Superclass::TransformType
TransformType;
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(
ImageSpatialObject,
SpatialObject );
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() const;
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 const char*
GetPixelType()
00105 {
00106
return m_PixelType.c_str();
00107 }
00108
00109
protected:
00110
00111 ImagePointer m_Image;
00112
00113
ImageSpatialObject();
00114
virtual ~ImageSpatialObject();
00115
00116
void PrintSelf( std::ostream& os,
Indent indent )
const;
00117
00118 int*
m_SlicePosition;
00119 std::string
m_PixelType;
00120 };
00121
00122 }
00123
00124
#ifndef ITK_MANUAL_INSTANTIATION
00125
#include "itkImageSpatialObject.txx"
00126
#endif
00127
00128
#endif //__itkImageSpatialObject_h