ITK  4.8.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();
73 
75  virtual const PointListType & GetPoints() const;
76 
78  virtual void SetPoints(PointListType & newPoints);
79 
81  virtual const SpatialObjectPointType * GetPoint(IdentifierType ind) const ITK_OVERRIDE
82  { return &( m_Points[ind] ); }
83 
85  virtual SpatialObjectPointType * GetPoint(IdentifierType ind) ITK_OVERRIDE
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 ITK_OVERRIDE
98  { return m_Points.size(); }
99 
101  itkSetMacro(EndType, unsigned int);
102  itkGetConstMacro(EndType, unsigned int);
104 
106  void Clear(void) ITK_OVERRIDE;
107 
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 ITK_OVERRIDE;
118 
123  bool ValueAt(const PointType & point, double & value,
124  unsigned int depth = 0, char *name = ITK_NULLPTR) const ITK_OVERRIDE;
125 
127  bool IsInside(const PointType & point,
128  unsigned int depth, char *name) const ITK_OVERRIDE;
129 
133  virtual bool IsInside(const PointType & point) const;
134 
136  bool ComputeLocalBoundingBox() const ITK_OVERRIDE;
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) ITK_OVERRIDE;
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 ITK_OVERRIDE;
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
Superclass::CovariantVectorType CovariantVectorType
PointListType * PointListPointer
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
void Clear(void) override
virtual PointListType & GetPoints()
PointBasedSpatialObject< TDimension > Superclass
virtual SizeValueType GetNumberOfPoints(void) const override
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::TransformType TransformType
This class serves as the base class for point-based spatial objects.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=nullptr) const override
unsigned int RemoveDuplicatePoints(unsigned int step=1)
Superclass::BoundingBoxType BoundingBoxType
virtual void SetPoint(IdentifierType ind, const TubePointType &pnt)
bool ComputeLocalBoundingBox() const override
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
virtual void RemovePoint(IdentifierType ind)
Superclass::TransformType TransformType
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=nullptr) const override
Point used for spatial objets.
virtual const SpatialObjectPointType * GetPoint(IdentifierType ind) const override
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
Representation of a tube based on the spatial object classes.
SmartPointer< Self > Pointer
bool IsInside(const PointType &point, unsigned int depth, char *name) const override
void CopyInformation(const DataObject *data) override
Base class for all data objects in ITK.
virtual SpatialObjectPointType * GetPoint(IdentifierType ind) override
SpatialObjectPoint< TDimension > SpatialObjectPointType
Superclass::CovariantVectorType CovariantVectorType