18 #ifndef itkSpatialObject_h
19 #define itkSpatialObject_h
56 template<
unsigned int VDimension = 3 >
69 static constexpr
unsigned int MaximumDepth = 9999999;
74 {
return MaximumDepth; }
123 {
return VDimension; }
133 itkGetConstReferenceMacro(Id,
int);
139 itkSetMacro(TypeName, std::string);
143 {
return m_TypeName; }
146 virtual std::string GetClassNameAndDimension(
void )
const;
150 { this->m_Property = property; this->Modified(); }
154 {
return this->m_Property; }
157 {
return this->m_Property; }
166 {
return Superclass::GetMTime(); }
176 void SetObjectToWorldTransform(
const TransformType * transform);
177 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
178 const TransformType * GetObjectToWorldTransformInverse()
const;
184 void ComputeObjectToWorldTransform();
188 void SetObjectToParentTransform(
const TransformType *transform);
189 itkGetModifiableObjectMacro(ObjectToParentTransform, TransformType);
190 const TransformType * GetObjectToParentTransformInverse()
const;
194 void ComputeObjectToParentTransform();
210 virtual bool ComputeMyBoundingBox()
const;
213 virtual bool IsInsideInObjectSpace(
const PointType & point,
214 unsigned int depth = 0,
215 const std::string & name =
"")
const;
219 void Update()
override;
223 virtual bool ValueAtInObjectSpace(
const PointType & point,
double & value,
224 unsigned int depth = 0,
225 const std::string & name =
"")
const;
233 virtual bool IsEvaluableAtInObjectSpace(
const PointType & point,
234 unsigned int depth = 0,
235 const std::string & name =
"")
const;
241 virtual bool IsInsideChildrenInObjectSpace(
const PointType & point,
242 unsigned int depth = 0,
const std::string & name =
"")
const;
244 virtual bool ValueAtChildrenInObjectSpace(
const PointType & point,
245 double & value,
unsigned int depth = 0,
246 const std::string & name =
"")
const;
248 virtual bool IsEvaluableAtChildrenInObjectSpace(
const PointType & point,
249 unsigned int depth = 0,
250 const std::string & name =
"")
const;
260 itkSetMacro(DefaultInsideValue,
double);
261 itkGetConstMacro(DefaultInsideValue,
double);
266 itkSetMacro(DefaultOutsideValue,
double);
267 itkGetConstMacro(DefaultOutsideValue,
double);
271 virtual bool ValueAtInWorldSpace(
const PointType & point,
double & value,
272 unsigned int depth = 0,
273 const std::string & name =
"")
const;
276 virtual bool IsInsideInWorldSpace(
const PointType & point,
277 unsigned int depth = 0,
278 const std::string & name =
"")
const;
281 virtual bool IsEvaluableAtInWorldSpace(
const PointType & point,
282 unsigned int depth = 0,
283 const std::string & name =
"")
const;
287 virtual void DerivativeAtInObjectSpace(
const PointType & point,
288 short unsigned int order,
289 CovariantVectorType & value,
290 unsigned int depth = 0,
291 const std::string & name =
"",
292 const DerivativeOffsetType & spacing = 1);
295 virtual void DerivativeAtInWorldSpace(
const PointType & point,
296 short unsigned int order,
297 CovariantVectorType & value,
298 unsigned int depth = 0,
299 const std::string & name =
"",
300 const DerivativeOffsetType & spacing = 1);
311 void SetParent(Self *parent);
315 virtual bool HasParent()
const;
319 virtual const Self * GetParent()
const;
322 virtual Self * GetParent();
325 itkSetMacro(ParentId,
int);
326 itkGetConstReferenceMacro(ParentId,
int);
336 void SetChildren(ChildrenListType & children);
339 void AddChild(Self *pointer );
343 bool RemoveChild(Self *
object);
346 void RemoveAllChildren(
unsigned int depth = MaximumDepth );
353 virtual ChildrenListType * GetChildren(
unsigned int depth = 0,
354 const std::string & name =
"")
const;
356 virtual void AddChildrenToList(ChildrenListType * children,
357 unsigned int depth = 0,
const std::string & name =
"")
const;
360 unsigned int GetNumberOfChildren(
unsigned int depth = 0,
361 const std::string & name =
"")
const;
369 bool FixParentChildHierarchyUsingParentIds();
372 bool CheckIdValidity()
const;
375 void FixIdValidity();
378 int GetNextAvailableId()
const;
389 itkGetConstObjectMacro( MyBoundingBoxInObjectSpace, BoundingBoxType );
394 virtual const BoundingBoxType * GetMyBoundingBoxInWorldSpace()
const;
398 virtual bool ComputeFamilyBoundingBox(
unsigned int depth = 0,
399 const std::string & name =
"" )
const;
403 itkGetConstObjectMacro( FamilyBoundingBoxInObjectSpace, BoundingBoxType );
407 virtual const BoundingBoxType * GetFamilyBoundingBoxInWorldSpace()
const;
421 virtual void SetLargestPossibleRegion(
const RegionType & region);
430 {
return m_LargestPossibleRegion; }
435 virtual void SetBufferedRegion(
const RegionType & region);
441 {
return m_BufferedRegion; }
447 virtual void SetRequestedRegion(
const RegionType & region);
453 void SetRequestedRegion(
const DataObject *data)
override;
460 {
return m_RequestedRegion; }
465 void SetRequestedRegionToLargestPossibleRegion()
override;
476 bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
486 bool VerifyRequestedRegion()
override;
495 void UpdateOutputInformation()
override;
506 void CopyInformation(
const DataObject *data)
override;
518 {
return this->IsInsideInWorldSpace(point); }
529 void PrintSelf(std::ostream & os,
Indent indent)
const override;
532 {
return m_MyBoundingBoxInObjectSpace.GetPointer(); }
576 #if !defined( ITK_WRAPPING_PARSER )
577 #ifndef ITK_MANUAL_INSTANTIATION
578 #include "itkSpatialObject.hxx"
582 #endif // itkSpatialObject_h
unsigned int GetMaximumDepth() const
std::list< Pointer > ChildrenListType
bool Evaluate(const PointType &point) const
ChildrenListType m_ChildrenList
TransformPointer m_ObjectToParentTransformInverse
Represent a n-dimensional index in a n-dimensional image.
std::list< Pointer > ObjectListType
double m_DefaultInsideValue
virtual const std::string GetTypeName() const
TransformPointer m_ObjectToWorldTransformInverse
virtual const RegionType & GetLargestPossibleRegion() const
BoundingBoxPointer m_FamilyBoundingBoxInObjectSpace
class ITK_FORWARD_EXPORT DataObject
RegionType m_RequestedRegion
RegionType m_LargestPossibleRegion
unsigned int ObjectDimensionType
TransformPointer m_ObjectToParentTransform
BoundingBoxPointer m_MyBoundingBoxInObjectSpace
A templated class holding a n-Dimensional vector.
SizeValueType IdentifierType
ChildrenListType * ChildrenListPointer
Implementation of the composite pattern.
Represent a n-dimensional size (bounds) of a n-dimensional image.
void SetProperty(const PropertyType &property)
unsigned int GetObjectDimension() const
const PropertyType & GetProperty() const
unsigned long ModifiedTimeType
typename BoundingBoxType::Pointer BoundingBoxPointer
RegionType m_BufferedRegion
BoundingBoxPointer m_MyBoundingBoxInWorldSpace
ModifiedTimeType GetMyMTime() const
virtual const RegionType & GetRequestedRegion() const
typename TransformType::Pointer TransformPointer
virtual const RegionType & GetBufferedRegion() const
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
PropertyType & GetProperty()
double m_DefaultOutsideValue
BoundingBoxPointer m_FamilyBoundingBoxInWorldSpace
TransformPointer m_ObjectToWorldTransform
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
BoundingBoxType * GetModifiableMyBoundingBoxInObjectSpace() const
A templated class holding a geometric point in n-Dimensional space.
A templated class holding a n-Dimensional covariant vector.
Base class for all data objects in ITK.
Represent and compute information about bounding boxes.