Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __itkImageSpatialObject2_h
00035 #define __itkImageSpatialObject2_h
00036
00037 #include "itkImage.h"
00038 #include "itkExceptionObject.h"
00039 #include "itkSpatialObject.h"
00040 #include "itkInterpolateImageFunction.h"
00041 #include "itkNearestNeighborInterpolateImageFunction.h"
00042
00043 namespace itk
00044 {
00045
00056 template < unsigned int TDimension = 3,
00057 class TPixelType = unsigned char
00058 >
00059 class ImageSpatialObject2
00060 : public SpatialObject< TDimension >
00061 {
00062
00063 public:
00064
00065 typedef double ScalarType;
00066 typedef ImageSpatialObject2< TDimension, TPixelType > Self;
00067 typedef SpatialObject< TDimension > Superclass;
00068 typedef SmartPointer< Self > Pointer;
00069 typedef SmartPointer< const Self > ConstPointer;
00070
00071 typedef TPixelType PixelType;
00072 typedef Image< PixelType, TDimension > ImageType;
00073 typedef typename ImageType::ConstPointer ImagePointer;
00074 typedef typename ImageType::IndexType IndexType;
00075 typedef typename ImageType::SizeType SizeType;
00076 typedef typename ImageType::RegionType RegionType;
00077 typedef typename Superclass::TransformType TransformType;
00078 typedef typename Superclass::PointType PointType;
00079 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00080 typedef InterpolateImageFunction<ImageType> InterpolatorType;
00081
00082 typedef NearestNeighborInterpolateImageFunction<ImageType>
00083 NNInterpolatorType;
00084
00085 typedef VectorContainer< unsigned long, PointType> PointContainerType;
00086 typedef typename PointContainerType::Pointer PointContainerPointer;
00087
00089 itkNewMacro( Self );
00090
00092 itkTypeMacro( ImageSpatialObject2, SpatialObject );
00093
00095 void SetImage( const ImageType * image );
00096
00098 const ImageType * GetImage( void ) const;
00099
00102 bool IsEvaluableAt( const PointType & point,
00103 unsigned int depth=0, char *name=NULL) const;
00104
00108 bool ValueAt( const PointType & point, double & value,
00109 unsigned int depth=0, char *name=NULL) const;
00110
00111
00113 bool IsInside( const PointType & point,
00114 unsigned int depth, char *name) const;
00115
00119 bool IsInside( const PointType & point) const;
00120
00122 bool ComputeLocalBoundingBox() const;
00123
00125 unsigned long GetMTime( void ) const;
00126
00128 void SetSlicePosition(unsigned int dimension, int position);
00129
00131 int GetSlicePosition(unsigned int dimension)
00132 {return m_SlicePosition[dimension];}
00133
00134 const char* GetPixelType()
00135 {
00136 return m_PixelType.c_str();
00137 }
00138
00140 void SetInterpolator(InterpolatorType * interpolator);
00141 itkGetObjectMacro(Interpolator,InterpolatorType);
00142
00143 protected:
00144 ImageSpatialObject2(const Self&);
00145 void operator=(const Self&);
00146
00147 ImagePointer m_Image;
00148
00149 ImageSpatialObject2();
00150 virtual ~ImageSpatialObject2();
00151
00152 void PrintSelf( std::ostream& os, Indent indent ) const;
00153
00154 int* m_SlicePosition;
00155 std::string m_PixelType;
00156
00157 typename InterpolatorType::Pointer m_Interpolator;
00158 };
00159
00160 }
00161
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkImageSpatialObject2.txx"
00164 #endif
00165
00166 #endif //__itkImageSpatialObject2_h