itkBlobSpatialObject.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkBlobSpatialObject_h
00019 #define __itkBlobSpatialObject_h
00020
00021 #include <list>
00022
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkSpatialObjectPoint.h"
00025
00026 namespace itk
00027 {
00028
00042 template < unsigned int TDimension = 3 >
00043 class BlobSpatialObject
00044 :public PointBasedSpatialObject< TDimension >
00045 {
00046
00047 public:
00048
00049 typedef BlobSpatialObject Self;
00050 typedef PointBasedSpatialObject< TDimension > Superclass;
00051 typedef SmartPointer < Self > Pointer;
00052 typedef SmartPointer < const Self > ConstPointer;
00053 typedef double ScalarType;
00054 typedef SpatialObjectPoint< TDimension > BlobPointType;
00055 typedef std::vector< BlobPointType > PointListType;
00056 typedef typename Superclass::PointType PointType;
00057 typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
00058 typedef typename Superclass::TransformType TransformType;
00059 typedef typename Superclass::BoundingBoxType BoundingBoxType;
00060 typedef VectorContainer<unsigned long,PointType> PointContainerType;
00061 typedef SmartPointer<PointContainerType> PointContainerPointer;
00062
00064 itkNewMacro( Self );
00065
00067 itkTypeMacro( BlobSpatialObject, SpatialObject );
00068
00070 PointListType & GetPoints( void );
00071
00073 const PointListType & GetPoints( void ) const;
00074
00076 void SetPoints( PointListType & newPoints );
00077
00079 const SpatialObjectPointType* GetPoint(unsigned long id) const
00080 {
00081 return &(m_Points[id]);
00082 }
00083
00085 SpatialObjectPointType* GetPoint(unsigned long id) {return &(m_Points[id]);}
00086
00088 unsigned long GetNumberOfPoints(void) const {return m_Points.size();}
00089
00092 bool IsEvaluableAt( const PointType & point,
00093 unsigned int depth=0, char * name=NULL ) const;
00094
00099 bool ValueAt( const PointType & point, double & value,
00100 unsigned int depth=0, char * name=NULL ) const;
00101
00103 bool IsInside( const PointType & point,
00104 unsigned int depth, char * name) const;
00105
00109 bool IsInside( const PointType & point) const;
00110
00112 bool ComputeLocalBoundingBox() const;
00113
00114 protected:
00115 BlobSpatialObject(const Self&);
00116 void operator=(const Self&);
00117
00118 PointListType m_Points;
00119
00120 BlobSpatialObject();
00121 virtual ~BlobSpatialObject();
00122
00124 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00125 };
00126
00127 }
00128
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkBlobSpatialObject.txx"
00131 #endif
00132
00133 #endif // __itkBlobSpatialObject_h
00134