ITK  5.0.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 {
39 template< unsigned int TDimension = 3 >
40 class ITK_TEMPLATE_EXPORT ContourSpatialObject:
41  public PointBasedSpatialObject< TDimension,
42  ContourSpatialObjectPoint< TDimension > >
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(ContourSpatialObject);
46 
48  using Superclass = PointBasedSpatialObject< TDimension,
52 
53  using ScalarType = double;
54 
56  using ContourPointListType = std::vector< ContourPointType >;
58  using ControlPointListType = std::vector< ControlPointType >;
59 
60  using PointType = typename Superclass::PointType;
61  using TransformType = typename Superclass::TransformType;
62  using BoundingBoxType = typename Superclass::BoundingBoxType;
65 
67  NO_INTERPOLATION = 0,
70  LINEAR_INTERPOLATION };
71 
73  itkNewMacro(Self);
74 
77 
80  { return m_ControlPoints; }
81 
84  { return m_ControlPoints; }
85 
87  void SetControlPoints(const ControlPointListType & newPoints);
88 
90  void AddControlPoint(const ControlPointType & point);
91 
94  { return &( m_ControlPoints[id] ); }
95 
98  { return &( m_ControlPoints[id] ); }
99 
102  { return static_cast<SizeValueType>( m_ControlPoints.size() ); }
103 
105  itkSetMacro( InterpolationMethod, InterpolationMethodType )
106 
107 
108  itkGetConstMacro( InterpolationMethod, InterpolationMethodType )
109 
112  itkSetMacro( InterpolationFactor, unsigned int )
113 
115  itkGetConstMacro( InterpolationFactor, unsigned int )
116 
118  itkSetMacro(IsClosed, bool);
119 
121  itkGetConstMacro(IsClosed, bool);
122 
124  int GetOrientationInObjectSpace() const;
125 
128  itkSetMacro(AttachedToSlice, int);
129 
132  itkGetConstMacro(AttachedToSlice, int);
133 
135  void Update() override;
136 
137 protected:
139  ~ContourSpatialObject() override = default;
140 
142  void PrintSelf(std::ostream & os, Indent indent) const override;
143 
144  typename LightObject::Pointer InternalClone() const override;
145 
146 private:
147  ContourPointListType m_ControlPoints;
148 
149  InterpolationMethodType m_InterpolationMethod;
150  unsigned int m_InterpolationFactor;
151 
152  mutable bool m_IsClosed;
153  mutable int m_OrientationInObjectSpace;
154  mutable ModifiedTimeType m_OrientationInObjectSpaceMTime;
155  int m_AttachedToSlice;
156 
157 };
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkContourSpatialObject.hxx"
162 #endif
163 
164 #endif // itkContourSpatialObject_h
std::vector< ContourPointType > ContourPointListType
Representation of a Contour based on the spatial object classes.
Light weight base class for most itk classes.
std::vector< ControlPointType > ControlPointListType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
This class serves as the base class for point-based spatial objects.
SizeValueType GetNumberOfControlPoints() const
Point used for a Contour definition.
typename Superclass::BoundingBoxType BoundingBoxType
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
ControlPointListType & GetControlPoints()
typename Superclass::TransformType TransformType
const ControlPointType * GetControlPoint(IdentifierType id) const
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
typename Superclass::PointType PointType
const ControlPointListType & GetControlPoints() const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
ControlPointType * GetControlPoint(IdentifierType id)
Base class for all data objects in ITK.