ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkTubeSpatialObject.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 __itkTubeSpatialObject_h
19 #define __itkTubeSpatialObject_h
20 
21 #include <list>
22 
25 
26 namespace itk
27 {
41 template< unsigned int TDimension = 3,
42  typename TTubePointType = TubeSpatialObjectPoint< TDimension > >
44  public PointBasedSpatialObject< TDimension >
45 {
46 public:
47 
52  typedef double ScalarType;
53  typedef TTubePointType TubePointType;
54  typedef std::vector< TubePointType > PointListType;
56  typedef typename Superclass::PointType PointType;
64 
66  itkNewMacro(Self);
67 
70 
72  virtual PointListType & GetPoints(void);
73 
75  virtual const PointListType & GetPoints(void) const;
76 
78  virtual void SetPoints(PointListType & newPoints);
79 
81  virtual const SpatialObjectPointType * GetPoint(IdentifierType ind) const
82  { return &( m_Points[ind] ); }
83 
86  { return &( m_Points[ind] ); }
87 
89  virtual void SetPoint(IdentifierType ind, const TubePointType & pnt)
90  { m_Points[ind] = pnt; }
91 
93  virtual void RemovePoint(IdentifierType ind)
94  { m_Points.erase(m_Points.begin() + ind); }
95 
97  virtual SizeValueType GetNumberOfPoints(void) const
98  { return m_Points.size(); }
99 
101  itkSetMacro(EndType, unsigned int);
102  itkGetConstMacro(EndType, unsigned int);
104 
106  void Clear(void);
107 
109  bool ComputeTangentAndNormals(void);
110 
112  unsigned int RemoveDuplicatePoints(unsigned int step = 1);
113 
116  bool IsEvaluableAt(const PointType & point,
117  unsigned int depth = 0, char *name = ITK_NULLPTR) const;
118 
123  bool ValueAt(const PointType & point, double & value,
124  unsigned int depth = 0, char *name = ITK_NULLPTR) const;
125 
127  bool IsInside(const PointType & point,
128  unsigned int depth, char *name) const;
129 
133  virtual bool IsInside(const PointType & point) const;
134 
136  bool ComputeLocalBoundingBox() const;
137 
140  itkSetMacro(ParentPoint, int);
141  itkGetConstMacro(ParentPoint, int);
143 
146  itkSetMacro(Root, bool);
147  itkGetConstMacro(Root, bool);
149 
151  itkSetMacro(Artery, bool);
152  itkGetConstMacro(Artery, bool);
154 
156  void CopyInformation(const DataObject *data);
157 
158 protected:
160 
162 
163  unsigned int m_EndType;
164 
165  bool m_Root;
166  bool m_Artery;
167 
169  virtual ~TubeSpatialObject();
170 
172  virtual void PrintSelf(std::ostream & os, Indent indent) const;
173 
177 
178 private:
179  TubeSpatialObject(const Self &); //purposely not implemented
180  void operator=(const Self &); //purposely not implemented
181 };
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkTubeSpatialObject.hxx"
186 #endif
187 
188 #endif // __itkTubeSpatialObject_h
Superclass::VectorType VectorType
void operator=(const Self &)
Superclass::CovariantVectorType CovariantVectorType
void CopyInformation(const DataObject *data)
virtual SpatialObjectPointType * GetPoint(IdentifierType ind)
PointListType * PointListPointer
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=ITK_NULLPTR) const
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
PointBasedSpatialObject< TDimension > Superclass
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
Superclass::TransformType TransformType
This class serves as the base class for point-based spatial objects.
bool ComputeLocalBoundingBox() const
unsigned long SizeValueType
Definition: itkIntTypes.h:143
virtual SizeValueType GetNumberOfPoints(void) const
unsigned int RemoveDuplicatePoints(unsigned int step=1)
Superclass::BoundingBoxType BoundingBoxType
virtual void SetPoint(IdentifierType ind, const TubePointType &pnt)
virtual const SpatialObjectPointType * GetPoint(IdentifierType ind) const
Point used for a tube definition.
virtual void SetPoints(PointListType &newPoints)
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
std::vector< TubePointType > PointListType
SmartPointer< const Self > ConstPointer
Superclass::SpatialObjectPointType SpatialObjectPointType
Superclass::PointType PointType
ModifiedTimeType m_IndexToWorldTransformMTime
SmartPointer< PointContainerType > PointContainerPointer
VectorContainer< IdentifierType, PointType > PointContainerType
bool IsInside(const PointType &point, unsigned int depth, char *name) const
virtual void RemovePoint(IdentifierType ind)
Superclass::TransformType TransformType
virtual void PrintSelf(std::ostream &os, Indent indent) const
bool ComputeTangentAndNormals(void)
Point used for spatial objets.
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=ITK_NULLPTR) const
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual PointListType & GetPoints(void)
Representation of a tube based on the spatial object classes.
SmartPointer< Self > Pointer
virtual ~TubeSpatialObject()
Base class for all data objects in ITK.
SpatialObjectPoint< TDimension > SpatialObjectPointType
Superclass::CovariantVectorType CovariantVectorType