ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkPolygonSpatialObject.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 itkPolygonSpatialObject_h
19 #define itkPolygonSpatialObject_h
20 #include "itkBlobSpatialObject.h"
21 
22 namespace itk
23 {
29 template< unsigned int TDimension = 3 >
30 class ITK_TEMPLATE_EXPORT PolygonSpatialObject:
31  public BlobSpatialObject< TDimension >
32 {
33 public:
38  typedef typename Superclass::PointType PointType;
39  typedef typename Superclass::TransformType TransformType;
40  typedef typename Superclass::PointListType PointListType;
41  typedef typename Superclass::BlobPointType BlobPointType;
43  itkNewMacro(Self);
44 
47 
52  typedef enum {
53  Axial = 0,
54  Coronal = 1,
55  Sagittal = 2,
56  UserPlane = 3,
57  Unknown = 4
58  } PolygonGroupOrientation;
59 
61  PolygonGroupOrientation Plane() const;
62 
64  itkSetMacro(Thickness, double);
65 
67  itkGetMacro(Thickness, double);
68 
70  bool IsClosed() const;
71 
73  unsigned int NumberOfPoints() const;
74 
76  PointType ClosestPoint(const PointType & curPoint) const;
77 
79  double MeasureArea() const;
80 
82  double MeasureVolume() const;
83 
85  double MeasurePerimeter() const;
86 
88  bool DeletePoint(const PointType & pointToDelete);
89 
91  bool AddPoint(const PointType & pointToAdd);
92 
94  bool InsertPoint(const PointType & point1, const PointType & pointToAdd);
95 
97  bool ReplacePoint(const PointType & oldpoint, const PointType & newPoint);
98 
100  bool RemoveSegment(const PointType & startpoint, const PointType & endPoint);
101 
103  virtual bool IsInside(const PointType & point,
104  unsigned int depth,
105  char *name) const ITK_OVERRIDE;
106 
110  virtual bool IsInside(const PointType & point) const;
111 
112 protected:
113  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
114 
115 private:
116  ITK_DISALLOW_COPY_AND_ASSIGN(PolygonSpatialObject);
117 
119  double m_Thickness;
121  {
122  m_Orientation = Unknown;
123  m_Thickness = 0.0;
124  }
125 };
126 }
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkPolygonSpatialObject.hxx"
129 #endif
130 
131 #endif // itkPolygonSpatialObject_h
Superclass::PointListType PointListType
Spatial object representing a potentially amorphous object.
Superclass::BlobPointType BlobPointType
Superclass::PointType PointType
PolygonSpatialObject< TDimension > Self
Superclass::TransformType TransformType
SmartPointer< const Self > ConstPointer
PolygonGroupOrientation
enumerates the possible spatial orientations
PolygonGroupOrientation m_Orientation
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all data objects in ITK.
BlobSpatialObject< TDimension > Superclass