ITK  4.10.0
Insight Segmentation and Registration Toolkit
itkBlobSpatialObject.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 itkBlobSpatialObject_h
19 #define itkBlobSpatialObject_h
20 
21 #include <list>
22 
24 
25 namespace itk
26 {
45 template< unsigned int TDimension = 3 >
47  public PointBasedSpatialObject< TDimension >
48 {
49 public:
50 
55  typedef double ScalarType;
57  typedef std::vector< BlobPointType > PointListType;
58  typedef typename Superclass::PointType PointType;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(BlobSpatialObject, SpatialObject);
70 
72  PointListType & GetPoints();
73 
75  const PointListType & GetPoints() const;
76 
78  void SetPoints(PointListType & newPoints);
79 
81  const SpatialObjectPointType * GetPoint(IdentifierType id) const ITK_OVERRIDE
82  {
83  return &( m_Points[id] );
84  }
85 
87  SpatialObjectPointType * GetPoint(IdentifierType id) ITK_OVERRIDE { return &( m_Points[id] ); }
88 
90  SizeValueType GetNumberOfPoints(void) const ITK_OVERRIDE
91  {
92  return static_cast<SizeValueType>( m_Points.size() );
93  }
94 
97  bool IsEvaluableAt(const PointType & point,
98  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
99 
104  bool ValueAt(const PointType & point, double & value,
105  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
106 
108  bool IsInside(const PointType & point,
109  unsigned int depth, char *name) const ITK_OVERRIDE;
110 
114  bool IsInside(const PointType & point) const;
115 
117  bool ComputeLocalBoundingBox() const ITK_OVERRIDE;
118 
119 protected:
120  BlobSpatialObject(const Self &) ITK_DELETE_FUNCTION;
121  void operator=(const Self &) ITK_DELETE_FUNCTION;
122 
123  PointListType m_Points;
124 
126  virtual ~BlobSpatialObject();
127 
129  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkBlobSpatialObject.hxx"
135 #endif
136 
137 #endif // itkBlobSpatialObject_h
SpatialObjectPoint< TDimension > BlobPointType
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=nullptr) const override
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
PointListType & GetPoints()
void operator=(const Self &) ITK_DELETE_FUNCTION
Superclass::SpatialObjectPointType SpatialObjectPointType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::BoundingBoxType BoundingBoxType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Definition: itkArray.h:30
Spatial object representing a potentially amorphous object.
Superclass::TransformType TransformType
SmartPointer< const Self > ConstPointer
This class serves as the base class for point-based spatial objects.
SmartPointer< PointContainerType > PointContainerPointer
unsigned long SizeValueType
Definition: itkIntTypes.h:143
PointBasedSpatialObject< TDimension > Superclass
Superclass::TransformType TransformType
SizeValueType GetNumberOfPoints(void) const override
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
bool ComputeLocalBoundingBox() const override
Implementation of the composite pattern.
const SpatialObjectPointType * GetPoint(IdentifierType id) const override
SmartPointer< Self > Pointer
bool IsInside(const PointType &point, unsigned int depth, char *name) const override
SpatialObjectPointType * GetPoint(IdentifierType id) override
Point used for spatial objets.
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetPoints(PointListType &newPoints)
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=nullptr) const override
Superclass::PointType PointType
virtual ~BlobSpatialObject()
std::vector< BlobPointType > PointListType
SpatialObjectPoint< TDimension > SpatialObjectPointType
VectorContainer< IdentifierType, PointType > PointContainerType