ITK  4.6.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(void) 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;
143 
148  bool ValueAt(const PointType & point, double & value,
149  unsigned int depth = 0, char *name = ITK_NULLPTR) const;
150 
152  bool IsInside(const PointType & point,
153  unsigned int depth, char *name) const;
154 
158  virtual bool IsInside(const PointType & point) const;
159 
161  bool ComputeLocalBoundingBox(void) const;
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;
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
void operator=(const Self &)
SmartPointer< const Self > ConstPointer
Superclass::PointType PointType
void SetInterpolationType(InterpolationType interpolation)
ControlPointListType & GetControlPoints(void)
Superclass::TransformType TransformType
const InterpolatedPointType * GetInterpolatedPoint(IdentifierType id) const
Superclass::TransformType TransformType
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=ITK_NULLPTR) const
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
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=ITK_NULLPTR) const
std::vector< ControlPointType > ControlPointListType
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 ComputeLocalBoundingBox(void) const
SpatialObjectPoint< TDimension > InterpolatedPointType
SizeValueType GetNumberOfControlPoints(void) const
virtual void PrintSelf(std::ostream &os, Indent indent) const
const ControlPointType * GetControlPoint(IdentifierType id) const
Point used for spatial objets.
Define a front-end to the STL &quot;vector&quot; 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
bool IsInside(const PointType &point, unsigned int depth, char *name) const
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
InterpolatedPointListType & GetInterpolatedPoints(void)