ITK  4.4.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 >
46 class ITK_EXPORT BlobSpatialObject:
47  public PointBasedSpatialObject< TDimension >
48 {
49 public:
50 
55  typedef double ScalarType;
57  typedef std::vector< BlobPointType > PointListType;
58  typedef typename Superclass::PointType PointType;
59  typedef typename Superclass::SpatialObjectPointType SpatialObjectPointType;
60  typedef typename Superclass::TransformType TransformType;
61  typedef typename Superclass::BoundingBoxType BoundingBoxType;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(BlobSpatialObject, SpatialObject);
70 
72  PointListType & GetPoints(void);
73 
75  const PointListType & GetPoints(void) const;
76 
78  void SetPoints(PointListType & newPoints);
79 
81  const SpatialObjectPointType * GetPoint(IdentifierType id) const
82  {
83  return &( m_Points[id] );
84  }
85 
87  SpatialObjectPointType * GetPoint(IdentifierType id) { return &( m_Points[id] ); }
88 
90  SizeValueType GetNumberOfPoints(void) const { return m_Points.size(); }
91 
94  bool IsEvaluableAt(const PointType & point,
95  unsigned int depth = 0, char *name = NULL) const;
96 
101  bool ValueAt(const PointType & point, double & value,
102  unsigned int depth = 0, char *name = NULL) const;
103 
105  bool IsInside(const PointType & point,
106  unsigned int depth, char *name) const;
107 
111  bool IsInside(const PointType & point) const;
112 
114  bool ComputeLocalBoundingBox() const;
115 
116 protected:
117  BlobSpatialObject(const Self &); //purposely not implemented
118  void operator=(const Self &); //purposely not implemented
119 
121 
123  virtual ~BlobSpatialObject();
124 
126  virtual void PrintSelf(std::ostream & os, Indent indent) const;
127 };
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkBlobSpatialObject.hxx"
132 #endif
133 
134 #endif // __itkBlobSpatialObject_h
135