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 __itkContourSpatialObject_h
00019 #define __itkContourSpatialObject_h
00020
00021 #include <list>
00022
00023 #include "itkPointBasedSpatialObject.h"
00024 #include "itkSpatialObjectPoint.h"
00025 #include "itkContourSpatialObjectPoint.h"
00026
00027 namespace itk
00028 {
00029
00039 template < unsigned int TDimension = 3 >
00040 class ITK_EXPORT ContourSpatialObject
00041 :public PointBasedSpatialObject< TDimension >
00042 {
00043
00044 public:
00045
00046 typedef ContourSpatialObject Self;
00047 typedef PointBasedSpatialObject< TDimension> Superclass;
00048 typedef SmartPointer < Self > Pointer;
00049 typedef SmartPointer < const Self > ConstPointer;
00050 typedef double ScalarType;
00051 typedef ContourSpatialObjectPoint< TDimension > ControlPointType;
00052 typedef SpatialObjectPoint< TDimension > InterpolatedPointType;
00053 typedef std::vector < ControlPointType > ControlPointListType;
00054 typedef std::vector < InterpolatedPointType > InterpolatedPointListType;
00055
00056 typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
00057 typedef typename Superclass::PointType PointType;
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( ContourSpatialObject, PointBasedSpatialObject );
00068
00070 ControlPointListType & GetControlPoints( void );
00071
00073 const ControlPointListType & GetControlPoints( void ) const;
00074
00076 void SetControlPoints( ControlPointListType & newPoints );
00077
00079 const ControlPointType* GetControlPoint(unsigned long id) const
00080 {return &(m_ControlPoints[id]);}
00081
00083 ControlPointType* GetControlPoint(unsigned long id)
00084 {return &(m_ControlPoints[id]);}
00085
00087 unsigned long GetNumberOfControlPoints(void) const
00088 {return m_ControlPoints.size();}
00089
00091 InterpolatedPointListType & GetInterpolatedPoints( void );
00092
00094 const InterpolatedPointListType & GetInterpolatedPoints( void ) const;
00095
00097 void SetInterpolatedPoints( InterpolatedPointListType & newPoints );
00098
00100 const InterpolatedPointType* GetInterpolatedPoint(unsigned long id) const
00101 {return &(m_InterpolatedPoints[id]);}
00102
00104 InterpolatedPointType* GetInterpolatedPoint(unsigned long id)
00105 {return &(m_InterpolatedPoints[id]);}
00106
00108 unsigned long GetNumberOfInterpolatedPoints(void) const
00109 {return m_InterpolatedPoints.size();}
00110
00111 enum InterpolationType {NO_INTERPOLATION=0,
00112 EXPLICIT_INTERPOLATION, BEZIER_INTERPOLATION,
00113 LINEAR_INTERPOLATION
00114 };
00115
00117 InterpolationType GetInterpolationType() const
00118 { return m_InterpolationType; }
00119 void SetInterpolationType(InterpolationType interpolation)
00120 {m_InterpolationType = interpolation;}
00122
00124 itkSetMacro(Closed,bool);
00125 itkGetConstMacro(Closed,bool);
00127
00129 itkSetMacro(DisplayOrientation,int);
00130 itkGetConstMacro(DisplayOrientation,int);
00132
00135 itkSetMacro(AttachedToSlice,int);
00136 itkGetConstMacro(AttachedToSlice,int);
00138
00144 bool IsEvaluableAt( const PointType & point,
00145 unsigned int depth=0, char *name = NULL ) const;
00146
00151 bool ValueAt( const PointType & point, double & value,
00152 unsigned int depth=0, char *name = NULL ) const;
00153
00155 bool IsInside( const PointType & point,
00156 unsigned int depth, char *name) const;
00157
00161 virtual bool IsInside( const PointType & point) const;
00162
00164 bool ComputeLocalBoundingBox( void ) const;
00165
00166 protected:
00167 ContourSpatialObject(const Self&);
00168 void operator=(const Self&);
00169
00170 ControlPointListType m_ControlPoints;
00171 InterpolatedPointListType m_InterpolatedPoints;
00172 InterpolationType m_InterpolationType;
00173 bool m_Closed;
00174 int m_DisplayOrientation;
00175 long int m_AttachedToSlice;
00176
00177 ContourSpatialObject();
00178 virtual ~ContourSpatialObject();
00179
00181 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00182 };
00183
00184 }
00185
00186 #ifndef ITK_MANUAL_INSTANTIATION
00187 #include "itkContourSpatialObject.txx"
00188 #endif
00189
00190 #endif // __itkContourSpatialObject_h
00191