ITK  4.10.0
Insight Segmentation and Registration Toolkit
itkContourSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkContourSpatialObject_h
19 #define itkContourSpatialObject_h
20 
21 #include <list>
22 
25 
26 namespace itk
27 {
38 template< unsigned int TDimension = 3 >
40  public PointBasedSpatialObject< TDimension >
41 {
42 public:
43 
48  typedef double ScalarType;
51  typedef std::vector< ControlPointType > ControlPointListType;
52  typedef std::vector< InterpolatedPointType > InterpolatedPointListType;
53 
55  typedef typename Superclass::PointType PointType;
60 
62  itkNewMacro(Self);
63 
66 
68  ControlPointListType & GetControlPoints();
69 
71  const ControlPointListType & GetControlPoints() const;
72 
74  void SetControlPoints(ControlPointListType & newPoints);
75 
77  const ControlPointType * GetControlPoint(IdentifierType id) const
78  { return &( m_ControlPoints[id] ); }
79 
81  ControlPointType * GetControlPoint(IdentifierType id)
82  { return &( m_ControlPoints[id] ); }
83 
86  { return static_cast<SizeValueType>( m_ControlPoints.size() ); }
87 
89  InterpolatedPointListType & GetInterpolatedPoints();
90 
92  const InterpolatedPointListType & GetInterpolatedPoints() const;
93 
95  void SetInterpolatedPoints(InterpolatedPointListType & newPoints);
96 
98  const InterpolatedPointType * GetInterpolatedPoint(IdentifierType id) const
99  { return &( m_InterpolatedPoints[id] ); }
100 
102  InterpolatedPointType * GetInterpolatedPoint(IdentifierType id)
103  { return &( m_InterpolatedPoints[id] ); }
104 
107  { return static_cast<SizeValueType>( m_InterpolatedPoints.size() ); }
108 
112 
115  { return m_InterpolationType; }
117  { m_InterpolationType = interpolation; }
119 
121  itkSetMacro(Closed, bool);
122  itkGetConstMacro(Closed, bool);
124 
126  itkSetMacro(DisplayOrientation, int);
127  itkGetConstMacro(DisplayOrientation, int);
129 
132  itkSetMacro(AttachedToSlice, int);
133  itkGetConstMacro(AttachedToSlice, int);
135 
141  bool IsEvaluableAt(const PointType & point,
142  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
143 
148  bool ValueAt(const PointType & point, double & value,
149  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
150 
152  bool IsInside(const PointType & point,
153  unsigned int depth, char *name) const ITK_OVERRIDE;
154 
158  virtual bool IsInside(const PointType & point) const;
159 
161  bool ComputeLocalBoundingBox(void) const ITK_OVERRIDE;
162 
163 protected:
164  ContourSpatialObject(const Self &) ITK_DELETE_FUNCTION;
165  void operator=(const Self &) ITK_DELETE_FUNCTION;
166 
167  ControlPointListType m_ControlPoints;
168  InterpolatedPointListType m_InterpolatedPoints;
170  bool m_Closed;
173 
175  virtual ~ContourSpatialObject();
176 
178  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
179 };
180 } // end namespace itk
181 
182 #ifndef ITK_MANUAL_INSTANTIATION
183 #include "itkContourSpatialObject.hxx"
184 #endif
185 
186 #endif // itkContourSpatialObject_h
Representation of a Contour based on the spatial object classes.
SmartPointer< PointContainerType > PointContainerPointer
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
SmartPointer< const Self > ConstPointer
Superclass::PointType PointType
void operator=(const Self &) ITK_DELETE_FUNCTION
void SetInterpolationType(InterpolationType interpolation)
Superclass::TransformType TransformType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Definition: itkArray.h:30
const InterpolatedPointType * GetInterpolatedPoint(IdentifierType id) const
Superclass::TransformType TransformType
VectorContainer< IdentifierType, PointType > PointContainerType
This class serves as the base class for point-based spatial objects.
InterpolationType GetInterpolationType() const
InterpolatedPointType * GetInterpolatedPoint(IdentifierType id)
unsigned long SizeValueType
Definition: itkIntTypes.h:143
std::vector< ControlPointType > ControlPointListType
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=nullptr) const override
bool ComputeLocalBoundingBox(void) const override
Point used for a Contour definition.
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Superclass::BoundingBoxType BoundingBoxType
SizeValueType GetNumberOfInterpolatedPoints(void) const
void SetInterpolatedPoints(InterpolatedPointListType &newPoints)
PointBasedSpatialObject< TDimension > Superclass
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=nullptr) const override
SpatialObjectPoint< TDimension > InterpolatedPointType
ControlPointListType & GetControlPoints()
SizeValueType GetNumberOfControlPoints(void) const
const ControlPointType * GetControlPoint(IdentifierType id) const
Point used for spatial objets.
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
ContourSpatialObjectPoint< TDimension > ControlPointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetControlPoints(ControlPointListType &newPoints)
InterpolatedPointListType m_InterpolatedPoints
virtual void PrintSelf(std::ostream &os, Indent indent) const override
InterpolatedPointListType & GetInterpolatedPoints()
std::vector< InterpolatedPointType > InterpolatedPointListType
ControlPointListType m_ControlPoints
Superclass::SpatialObjectPointType SpatialObjectPointType
ControlPointType * GetControlPoint(IdentifierType id)
bool IsInside(const PointType &point, unsigned int depth, char *name) const override
SpatialObjectPoint< TDimension > SpatialObjectPointType