ITK  4.8.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 
69 
71  const ControlPointListType & GetControlPoints() const;
72 
74  void SetControlPoints(ControlPointListType & newPoints);
75 
78  { return &( m_ControlPoints[id] ); }
79 
82  { return &( m_ControlPoints[id] ); }
83 
86  { return m_ControlPoints.size(); }
87 
90 
93 
96 
99  { return &( m_InterpolatedPoints[id] ); }
100 
103  { return &( m_InterpolatedPoints[id] ); }
104 
107  { return 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 &); //purposely not implemented
165  void operator=(const Self &); //purposely not implemented
166 
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
bool IsInside(const PointType &point, unsigned int depth, char *name) const override
SmartPointer< const Self > ConstPointer
Superclass::PointType PointType
void SetInterpolationType(InterpolationType interpolation)
Superclass::TransformType TransformType
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
Point used for a Contour definition.
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=nullptr) const override
Superclass::BoundingBoxType BoundingBoxType
SizeValueType GetNumberOfInterpolatedPoints(void) const
void SetInterpolatedPoints(InterpolatedPointListType &newPoints)
PointBasedSpatialObject< TDimension > Superclass
SpatialObjectPoint< TDimension > InterpolatedPointType
ControlPointListType & GetControlPoints()
SizeValueType GetNumberOfControlPoints(void) const
virtual void PrintSelf(std::ostream &os, Indent indent) const override
const ControlPointType * GetControlPoint(IdentifierType id) const
Point used for spatial objets.
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=nullptr) const override
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
bool ComputeLocalBoundingBox(void) const override
ContourSpatialObjectPoint< TDimension > ControlPointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetControlPoints(ControlPointListType &newPoints)
InterpolatedPointListType m_InterpolatedPoints
InterpolatedPointListType & GetInterpolatedPoints()
std::vector< InterpolatedPointType > InterpolatedPointListType
ControlPointListType m_ControlPoints
Superclass::SpatialObjectPointType SpatialObjectPointType
ControlPointType * GetControlPoint(IdentifierType id)
Base class for all data objects in ITK.
SpatialObjectPoint< TDimension > SpatialObjectPointType