18 #ifndef itkSpatialObject_h
19 #define itkSpatialObject_h
56 template<
unsigned int VDimension >
59 template<
unsigned int VDimension = 3 >
67 itkStaticConstMacro(MaximumDepth,
unsigned int, 9999999);
124 virtual bool HasParent()
const;
127 virtual const char *
GetTypeName(
void)
const {
return m_TypeName.c_str(); }
132 itkStaticConstMacro(ObjectDimension,
unsigned int, VDimension);
150 void SetObjectToWorldTransform(TransformType *transform);
151 itkGetModifiableObjectMacro(ObjectToWorldTransform, TransformType);
154 itkGetModifiableObjectMacro(IndexToWorldTransform, TransformType);
159 void ComputeObjectToWorldTransform();
162 void ComputeObjectToParentTransform();
171 virtual bool ValueAt(
const PointType & point,
double & value,
172 unsigned int depth = 0,
173 char *name = ITK_NULLPTR)
const;
181 virtual bool IsEvaluableAt(
const PointType & point,
182 unsigned int depth = 0,
183 char *name = ITK_NULLPTR)
const;
186 virtual bool IsInside(
const PointType & point,
187 unsigned int depth = 0,
188 char *name = ITK_NULLPTR)
const;
196 return this->IsInside(point);
200 virtual void DerivativeAt(
const PointType & point,
201 short unsigned int order,
202 OutputVectorType & value,
203 unsigned int depth = 0,
204 char *name = ITK_NULLPTR);
214 return Superclass::GetMTime();
223 virtual void SetLargestPossibleRegion(
const RegionType & region);
232 {
return m_LargestPossibleRegion; }
237 virtual void SetBufferedRegion(
const RegionType & region);
243 {
return m_BufferedRegion; }
262 {
return m_RequestedRegion; }
287 for (
int i = VDimension - 1; i > 0; i-- )
289 offset += ( ind[i] - bufferedRegionIndex[i] ) * m_OffsetTable[i];
291 offset += ( ind[0] - bufferedRegionIndex[0] );
304 for (
int i = VDimension - 1; i > 0; i-- )
306 index[i] =
static_cast< IndexValueType >( offset / m_OffsetTable[i] );
307 offset -= ( index[i] * m_OffsetTable[i] );
308 index[i] += bufferedRegionIndex[i];
310 index[0] = bufferedRegionIndex[0] +
static_cast< IndexValueType >( offset );
362 PropertyType * GetProperty();
367 void SetProperty(PropertyType *property);
370 itkGetConstReferenceMacro(Id,
int);
371 itkSetMacro(Id,
int);
375 itkSetMacro(ParentId,
int);
376 itkGetConstReferenceMacro(ParentId,
int);
380 virtual void Update(
void) ITK_OVERRIDE;
383 itkSetObjectMacro(
TreeNode, TreeNodeType)
386 itkGetModifiableObjectMacro(TreeNode, TreeNodeType);
391 void SetSpacing(const
double spacing[itkGetStaticConstMacro(ObjectDimension)])
393 m_AffineGeometryFrame->GetModifiableIndexToObjectTransform()->SetScale(spacing);
400 return this->GetIndexToObjectTransform()->GetScale();
408 const TransformType * GetIndexToObjectTransform()
const;
412 return m_AffineGeometryFrame->GetModifiableIndexToObjectTransform();
416 return m_AffineGeometryFrame->GetModifiableIndexToObjectTransform();
423 void SetObjectToParentTransform(TransformType *transform);
425 TransformType * GetObjectToParentTransform();
427 const TransformType * GetObjectToParentTransform()
const;
432 TransformType * GetObjectToNodeTransform();
434 const TransformType * GetObjectToNodeTransform()
const;
440 void AddSpatialObject(Self *pointer);
446 void RemoveSpatialObject(Self *
object);
449 virtual const Self * GetParent()
const;
452 virtual Self * GetParent();
459 virtual ChildrenListType * GetChildren(
unsigned int depth = 0,
460 char *name = ITK_NULLPTR)
const;
463 unsigned int GetNumberOfChildren(
unsigned int depth = 0,
464 char *name = ITK_NULLPTR)
const;
467 void SetChildren(ChildrenListType & children);
471 virtual void Clear();
495 virtual bool ComputeBoundingBox()
const;
499 std::cerr <<
"SpatialObject::ComputeLocalBoundingBox Not Implemented!"
506 virtual BoundingBoxType * GetBoundingBox()
const;
509 itkSetMacro(BoundingBoxChildrenDepth,
unsigned int);
510 itkGetConstReferenceMacro(BoundingBoxChildrenDepth,
unsigned int);
515 itkSetMacro(BoundingBoxChildrenName, std::string);
516 itkGetConstReferenceMacro(BoundingBoxChildrenName, std::string);
521 void SetParent(Self *parent);
524 void SetNodeToParentNodeTransform(TransformType *transform);
526 TransformType * GetNodeToParentNodeTransform();
528 const TransformType * GetNodeToParentNodeTransform()
const;
532 itkSetMacro(DefaultInsideValue,
double);
533 itkGetConstMacro(DefaultInsideValue,
double);
538 itkSetMacro(DefaultOutsideValue,
double);
539 itkGetConstMacro(DefaultOutsideValue,
double);
544 virtual std::string GetSpatialObjectTypeAsString()
const;
554 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
560 void ComputeOffsetTable();
562 itkSetMacro(Dimension,
unsigned int);
563 itkGetConstReferenceMacro(Dimension,
unsigned int)
564 itkSetMacro(TypeName, std::string);
565 itkGetModifiableObjectMacro(Bounds, BoundingBoxType);
566 itkGetModifiableObjectMacro(InternalInverseTransform, TransformType);
574 bool SetInternalInverseTransformToWorldToIndexTransform()
const;
628 #if !defined( ITK_WRAPPING_PARSER )
629 #ifndef ITK_MANUAL_INSTANTIATION
630 #include "itkSpatialObject.hxx"
634 #endif // itkSpatialObject_h
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion()
unsigned int GetMaximumDepth() const
virtual void CopyInformation(const DataObject *)
const IndexValueType * GetIndex() const
Index< VDimension > IndexType
Point< ScalarType, VDimension > PointType
bool Evaluate(const PointType &point) const
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Offset< VDimension > OffsetType
Represents a node in a tree.
virtual const double * GetSpacing() const
ImageRegion< VDimension > RegionType
BoundingBox< IdentifierType, VDimension, ScalarType, VectorContainerType > BoundingBoxType
SpatialObjectProperty< float > PropertyType
SpatialObject< VDimension > Self
SmartPointer< const Self > ConstPointer
Represent the size (bounds) of a n-dimensional image.
TransformType * GetModifiableIndexToObjectTransform(void)
signed long OffsetValueType
virtual void UpdateOutputInformation()
AffineGeometryFrameType::Pointer AffineGeometryFramePointer
signed long IndexValueType
unsigned long ModifiedTimeType
double m_DefaultInsideValue
virtual bool ComputeLocalBoundingBox() const
TransformPointer m_InternalInverseTransform
CovariantVector< double, VDimension > OutputVectorType
virtual const RegionType & GetLargestPossibleRegion() const
SmartPointer< Self > Pointer
VectorContainer< IdentifierType, PointType > VectorContainerType
TransformType * GetIndexToObjectTransform(void)
AffineGeometryFramePointer m_AffineGeometryFrame
RegionType m_RequestedRegion
AffineGeometryFrame< double, VDimension > AffineGeometryFrameType
TransformType::Pointer TransformPointer
const TransformType * TransformConstPointer
RegionType m_LargestPossibleRegion
IndexType ComputeIndex(OffsetValueType offset) const
PropertyType::Pointer PropertyPointer
unsigned int m_BoundingBoxChildrenDepth
TransformPointer m_ObjectToParentTransform
OutputVectorType * OutputVectorPointer
virtual void SetRequestedRegion(const DataObject *)
const OffsetValueType * GetOffsetTable() const
VectorType * VectorPointer
ModifiedTimeType m_BoundsMTime
A templated class holding a n-Dimensional vector.
ChildrenListType m_InternalChildrenList
virtual bool VerifyRequestedRegion()
Size< VDimension > SizeType
std::string m_BoundingBoxChildrenName
virtual void SetRequestedRegionToLargestPossibleRegion()
Implementation of the composite pattern.
SpatialObjectTreeNode< VDimension > TreeNodeType
PropertyPointer m_Property
std::list< Pointer > ChildrenListType
Vector< ScalarType, VDimension > VectorType
BoundingBoxPointer m_Bounds
RegionType m_BufferedRegion
Base class for all data objects in ITK.
virtual const RegionType & GetRequestedRegion() const
ChildrenListType * ChildrenListPointer
CovariantVector< ScalarType, VDimension > CovariantVectorType
virtual const RegionType & GetBufferedRegion() const
virtual const char * GetTypeName(void) const
Point< ScalarType, VDimension > InputType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
ScalableAffineTransform< double, VDimension > TransformType
TreeNodeType::Pointer m_TreeNode
unsigned int GetObjectDimension(void) const
double m_DefaultOutsideValue
OffsetValueType ComputeOffset(const IndexType &ind) const
Describes the geometry of a data object.
class ITK_TEMPLATE_EXPORT SpatialObject
TransformPointer m_ObjectToWorldTransform
A templated class holding a geometric point in n-Dimensional space.
A templated class holding a n-Dimensional covariant vector.
BoundingBoxType::Pointer BoundingBoxPointer
Represent and compute information about bounding boxes.
TransformPointer m_IndexToWorldTransform