MorphologicalAttributeFilters
Public API documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Friends | List of all members
mmcfilters::MorphologicalTree Class Reference

Mutable morphological tree built directly on proper parts and dense node ids. More...

#include <MorphologicalTree.hpp>

Classes

class  AliveNodeIterator
 Iterator over live node ids in the dense internal-node domain. More...
 
class  AliveNodeRange
 Range wrapper for iterating over live node ids. More...
 
class  BreadthFirstNodeIterator
 Breadth-first iterator over one subtree. More...
 
class  BreadthFirstNodeRange
 Range wrapper for breadth-first subtree traversal. More...
 
class  ChildrenIterator
 Iterator over the direct children of one node. More...
 
class  ChildrenRange
 Range wrapper for direct-child iteration. More...
 
class  ConnectedComponentIterator
 Iterator over all proper parts in one connected component. More...
 
class  ConnectedComponentRange
 Range wrapper for connected-component proper-part iteration. More...
 
class  DescendantNodeRange
 Range wrapper over the proper descendants of one node. More...
 
class  PathBetweenNodesIterator
 Iterator over a materialised path between two nodes. More...
 
class  PathBetweenNodesRange
 Range wrapper for the path connecting two nodes in the same component. More...
 
class  PathToRootIterator
 Iterator that walks from a node towards the root. More...
 
class  PathToRootRange
 Range wrapper for rootward path traversal. More...
 
class  PostOrderNodeIterator
 Post-order iterator over one subtree. More...
 
class  PostOrderNodeRange
 Range wrapper for post-order subtree traversal. More...
 
class  ProperPartsIterator
 Iterator over the direct proper parts owned by one node. More...
 
class  ProperPartsRange
 Range wrapper for direct proper-part iteration. More...
 
class  SubtreeNodeIterator
 Depth-first iterator over a subtree in pre-order. More...
 
class  SubtreeNodeRange
 Range wrapper for pre-order subtree traversal. More...
 

Public Member Functions

 MorphologicalTree (const MorphologicalTree &)=delete
 Copying is disabled to keep topology ownership explicit.
 
MorphologicalTreeoperator= (const MorphologicalTree &)=delete
 Copy assignment is disabled to keep topology ownership explicit.
 
 MorphologicalTree (MorphologicalTree &&) noexcept=default
 Moving transfers the complete topology state.
 
MorphologicalTreeoperator= (MorphologicalTree &&) noexcept=default
 Move assignment transfers the complete topology state.
 
virtual ~MorphologicalTree ()=default
 Destroys the topology storage and cached traversal state.
 
template<AltitudeValue PixelType>
 MorphologicalTree (detail::MorphologicalTreeConstructionTag, ImagePtr< PixelType > imgPtr, ComponentTreeKind kind, double radius)
 Tag-protected constructor for image-based max/min component trees.
 
 MorphologicalTree (detail::MorphologicalTreeConstructionTag, ImageUInt8Ptr imgPtr, ToSInterpolation interpolation, int infinitySeedRow, int infinitySeedCol)
 Tag-protected constructor for image-based tree-of-shapes topology.
 
 MorphologicalTree (detail::MorphologicalTreeConstructionTag, std::span< const NodeId > parent, int rows, int cols, MorphologicalTreeKind kind, std::optional< AdjacencyRelation > adjacency)
 Tag-protected import from compact Higra parent representation.
 
 MorphologicalTree (detail::MorphologicalTreeConstructionTag, std::span< const NodeId > nodeParent, std::span< const NodeId > properPartOwner, NodeId root, int rows, int cols)
 Tag-protected import from native MAF topology buffers.
 
MorphologicalTree clone () const
 Creates an independent copy of the structural tree state.
 
std::size_t getMutationVersion () const noexcept
 Returns the monotonic mutation counter used by read-only views.
 
void requireMutationVersion (std::size_t expectedVersion, const char *context) const
 Rejects stale read-only views that captured an older mutation version.
 
int getNumInternalNodeSlots () const
 Returns the size of the dense internal-node id domain.
 
int getNumTotalProperParts () const
 Returns the size of the proper-part domain.
 
int getNumHigraNodes () const
 Returns the size of the preserved imported Higra node-id domain.
 
int getNodeIdSpaceSize (NodeIdSpace outputSpace) const
 Returns the size of the requested node-id domain.
 
NodeId getHigraNodeId (NodeId nodeId) const noexcept
 Returns the preserved imported Higra node id for one live tree node.
 
NodeId getRoot () const
 Returns the current hierarchy root.
 
bool isNode (NodeId nodeId) const noexcept
 Tests whether nodeId belongs to the internal-node id domain.
 
bool isProperPart (NodeId id) const noexcept
 Tests whether id belongs to the proper-part domain.
 
bool isAlive (NodeId nodeId) const
 Tests whether a node slot currently represents a live node.
 
bool isRoot (NodeId nodeId) const
 Tests whether nodeId is the current root.
 
int getNumFreeNodeSlots () const
 Returns the number of currently reusable node slots.
 
int getNumLeafNodes () const
 Counts the live nodes that currently have no children.
 
int getNumChildren (NodeId nodeId) const
 Returns the number of direct children of nodeId.
 
int getNodeNumDescendants (NodeId nodeId) const
 Returns the number of internal descendants of nodeId.
 
int getNodeNumSiblings (NodeId nodeId) const
 Returns the number of siblings of nodeId.
 
int getNodeTimePreOrder (NodeId nodeId) const
 Returns the preorder time of nodeId in the cached DFS traversal.
 
int getNodeTimePostOrder (NodeId nodeId) const
 Returns the postorder time of nodeId in the cached DFS traversal.
 
NodeId getFirstChild (NodeId nodeId) const
 Returns the first direct child of nodeId, or InvalidNode.
 
NodeId getNextSibling (NodeId nodeId) const
 Returns the next sibling of nodeId, or InvalidNode.
 
bool isLeaf (NodeId nodeId) const
 Tests whether nodeId has no direct children.
 
int getNumProperParts (NodeId nodeId) const
 Returns the number of direct proper parts owned by nodeId.
 
bool hasChild (NodeId parentNodeId, NodeId childId) const
 Tests whether childId is a direct child of parentNodeId.
 
NodeId getNodeParent (NodeId nodeId) const
 Returns the direct parent of nodeId.
 
NodeId getProperPartOwner (NodeId properPartId) const
 Returns the live node that directly owns properPartId.
 
std::vector< NodeIdgetLeaves () const
 Returns all live leaf nodes in the current hierarchy.
 
MorphologicalTreeKind getTreeType () const noexcept
 Returns the current tree type.
 
int getNumNodes () const noexcept
 Returns the number of currently live nodes.
 
bool isEditing () const noexcept
 Tests whether a staged edit session is currently open.
 
void requireNotEditing (const char *context) const
 Rejects operations that require a committed connected topology.
 
bool hasDetachedAliveNodes () const noexcept
 Returns whether the tree currently contains alive detached nodes.
 
bool hasAdjacencyRelation () const noexcept
 Tests whether an adjacency relation is attached to the tree.
 
bool hasTreeOfShapesAdjacencyPolicy () const noexcept
 Tests whether this image-built tree of shapes carries min/max auxiliary adjacency metadata.
 
double getTreeOfShapesMinTreeAdjacencyRadius () const
 Returns the auxiliary min-tree adjacency radius used by the ToS interpolation policy.
 
double getTreeOfShapesMaxTreeAdjacencyRadius () const
 Returns the auxiliary max-tree adjacency radius used by the ToS interpolation policy.
 
const AdjacencyRelationgetTreeOfShapesMinTreeAdjacencyRelation () const noexcept
 Returns the auxiliary min-tree adjacency relation used by the ToS interpolation policy.
 
const AdjacencyRelationgetTreeOfShapesMaxTreeAdjacencyRelation () const noexcept
 Returns the auxiliary max-tree adjacency relation used by the ToS interpolation policy.
 
int getNumRowsOfImage () const
 Returns the number of image rows in the attached 2D domain.
 
int getNumColsOfImage () const
 Returns the number of image columns in the attached 2D domain.
 
AdjacencyRelationgetAdjacencyRelation () noexcept
 Returns the mutable adjacency relation attached to the tree, if any.
 
const AdjacencyRelationgetAdjacencyRelation () const noexcept
 Returns the read-only adjacency relation attached to the tree, if any.
 
void validateConnectedRootedTree () const
 Validates that the current structure is one connected rooted tree.
 
TreeValidationResult validateConnectedRootedTreeResult () const noexcept
 Runs strong validation and returns the result instead of throwing.
 
bool isAncestor (NodeId u, NodeId v) const
 Tests whether u is an ancestor of v.
 
bool isDescendant (NodeId u, NodeId v) const
 Tests whether u is a descendant of v.
 
bool isComparable (NodeId u, NodeId v) const
 Tests whether u and v are comparable in the ancestry order.
 
bool isStrictAncestor (NodeId u, NodeId v) const
 Tests whether u is a strict ancestor of v.
 
bool isStrictDescendant (NodeId u, NodeId v) const
 Tests whether u is a strict descendant of v.
 
bool isStrictComparable (NodeId u, NodeId v) const
 Tests whether u and v are strictly comparable in the ancestry order.
 
NodeId getLowestCommonAncestor (NodeId u, NodeId v) const
 Returns the lowest common ancestor of u and v.
 
AliveNodeRange getAliveNodeIds () const
 Returns a fail-fast range over all live node ids.
 
ChildrenRange getChildren (NodeId nodeId) const
 Returns a fail-fast range over the direct children of nodeId.
 
ProperPartsRange getProperParts (NodeId nodeId) const
 Returns a fail-fast range over the direct proper parts of nodeId.
 
ConnectedComponentRange getConnectedComponent (NodeId nodeId) const
 Returns a fail-fast range over all proper parts in the connected component represented by nodeId.
 
PostOrderNodeRange getPostOrderNodes () const
 Returns a post-order traversal range rooted at the connected root.
 
PostOrderNodeRange getPostOrderNodes (NodeId rootNodeId) const
 Returns a post-order traversal range rooted at rootNodeId.
 
BreadthFirstNodeRange getIteratorBreadthFirstTraversal () const
 Returns a breadth-first traversal range rooted at the connected root.
 
BreadthFirstNodeRange getIteratorBreadthFirstTraversal (NodeId rootNodeId) const
 Returns a breadth-first traversal range rooted at rootNodeId.
 
PathToRootRange getPathToRootNodes (NodeId nodeId) const
 Returns the path from nodeId to the connected root.
 
PathBetweenNodesRange getPathBetweenNodes (NodeId sourceNodeId, NodeId targetNodeId) const
 Returns the path that connects sourceNodeId and targetNodeId.
 
SubtreeNodeRange getNodeSubtree (NodeId nodeId) const
 Returns a pre-order traversal range over the subtree of nodeId.
 
DescendantNodeRange getDescendants (NodeId nodeId) const
 Returns a range over all proper descendants of nodeId.
 
TreeEditor edit ()
 Opens the only public entrypoint for staged structural mutations.
 
void pruneNode (NodeId nodeId)
 Prunes the subtree of nodeId, moving all its support to the parent.
 
void mergeNodeIntoParent (NodeId nodeId)
 Merges nodeId into its parent and releases the emptied slot.
 

Friends

class TreeEditor
 

Detailed Description

Mutable morphological tree built directly on proper parts and dense node ids.

MorphologicalTree is the central mutable hierarchy of this project. It can represent a max-tree, min-tree, or tree of shapes and exposes a dense NodeId domain together with direct proper-part ownership. The class keeps explicit parent/child links, linked lists of direct proper parts, optional 2D image-domain metadata, and a small set of structural caches used by the public traversal and ancestry queries.

Data model:

Main responsibilities:

The class intentionally keeps only the canonical structural state and a small number of derived caches. Higher-level attribute computation is delegated to the incremental attribute computers in mmcfilters/attributes.

Definition at line 120 of file MorphologicalTree.hpp.

Constructor & Destructor Documentation

◆ MorphologicalTree() [1/4]

template<AltitudeValue PixelType>
mmcfilters::MorphologicalTree::MorphologicalTree ( detail::MorphologicalTreeConstructionTag  ,
ImagePtr< PixelType imgPtr,
ComponentTreeKind  kind,
double  radius 
)
inline

Tag-protected constructor for image-based max/min component trees.

The factory owns this path. The resulting topology uses the image pixels as proper parts, stores the selected component-tree type internally, and keeps the adjacency relation used by later topology-aware operations.

Definition at line 989 of file MorphologicalTree.hpp.

◆ MorphologicalTree() [2/4]

mmcfilters::MorphologicalTree::MorphologicalTree ( detail::MorphologicalTreeConstructionTag  ,
ImageUInt8Ptr  imgPtr,
ToSInterpolation  interpolation,
int  infinitySeedRow,
int  infinitySeedCol 
)
inline

Tag-protected constructor for image-based tree-of-shapes topology.

The factory owns this path. The topology uses the image pixels as proper parts and stores the ToS interpolation policy as adjacency metadata for operations that need to preserve the same interpretation.

Definition at line 1034 of file MorphologicalTree.hpp.

◆ MorphologicalTree() [3/4]

mmcfilters::MorphologicalTree::MorphologicalTree ( detail::MorphologicalTreeConstructionTag  ,
std::span< const NodeId parent,
int  rows,
int  cols,
MorphologicalTreeKind  kind,
std::optional< AdjacencyRelation adjacency 
)
inline

Tag-protected import from compact Higra parent representation.

Higra ids are leaves first and internal nodes after the image-domain leaves. The constructor converts internal Higra ids to dense internal NodeId slots while preserving enough mapping metadata for weighted altitude import. Max/min imports require an adjacency relation; tree of shapes imports can omit it.

Definition at line 1080 of file MorphologicalTree.hpp.

◆ MorphologicalTree() [4/4]

mmcfilters::MorphologicalTree::MorphologicalTree ( detail::MorphologicalTreeConstructionTag  ,
std::span< const NodeId nodeParent,
std::span< const NodeId properPartOwner,
NodeId  root,
int  rows,
int  cols 
)
inline

Tag-protected import from native MAF topology buffers.

This path is used by builders that already materialize internal-node parent links and row-major proper-part owners, such as the SDRT builder. The buffers are copied into canonical tree storage and validated as one connected rooted hierarchy.

Definition at line 1167 of file MorphologicalTree.hpp.

Member Function Documentation

◆ clone()

MorphologicalTree mmcfilters::MorphologicalTree::clone ( ) const
inline

Creates an independent copy of the structural tree state.

The public copy constructor stays deleted so ownership remains explicit at API boundaries. This method is used by wrappers that need to preserve a caller-owned topology while creating a new tree-backed object.

Definition at line 1255 of file MorphologicalTree.hpp.

◆ edit()

TreeEditor mmcfilters::MorphologicalTree::edit ( )
inline

Opens the only public entrypoint for staged structural mutations.

Use this for multi-step topology rewiring that may temporarily detach nodes, move children/proper parts, or create intermediate nodes. TreeEditor::commit() runs the strong connected-rooted-tree validation.

Defined in TreeEditor.hpp after TreeEditor is complete; at this point only the forward declaration is available.

Definition at line 337 of file TreeEditor.hpp.

◆ getAdjacencyRelation() [1/2]

const AdjacencyRelation * mmcfilters::MorphologicalTree::getAdjacencyRelation ( ) const
inlinenoexcept

Returns the read-only adjacency relation attached to the tree, if any.

Definition at line 1688 of file MorphologicalTree.hpp.

◆ getAdjacencyRelation() [2/2]

AdjacencyRelation * mmcfilters::MorphologicalTree::getAdjacencyRelation ( )
inlinenoexcept

Returns the mutable adjacency relation attached to the tree, if any.

Definition at line 1683 of file MorphologicalTree.hpp.

◆ getAliveNodeIds()

AliveNodeRange mmcfilters::MorphologicalTree::getAliveNodeIds ( ) const
inline

Returns a fail-fast range over all live node ids.

Definition at line 1973 of file MorphologicalTree.hpp.

◆ getChildren()

ChildrenRange mmcfilters::MorphologicalTree::getChildren ( NodeId  nodeId) const
inline

Returns a fail-fast range over the direct children of nodeId.

Definition at line 1980 of file MorphologicalTree.hpp.

◆ getConnectedComponent()

ConnectedComponentRange mmcfilters::MorphologicalTree::getConnectedComponent ( NodeId  nodeId) const
inline

Returns a fail-fast range over all proper parts in the connected component represented by nodeId.

The range walks the subtree rooted at nodeId and yields every direct proper part owned by those nodes, without materialising a vector.

Definition at line 2000 of file MorphologicalTree.hpp.

◆ getDescendants()

DescendantNodeRange mmcfilters::MorphologicalTree::getDescendants ( NodeId  nodeId) const
inline

Returns a range over all proper descendants of nodeId.

Definition at line 2063 of file MorphologicalTree.hpp.

◆ getFirstChild()

NodeId mmcfilters::MorphologicalTree::getFirstChild ( NodeId  nodeId) const
inline

Returns the first direct child of nodeId, or InvalidNode.

Definition at line 1484 of file MorphologicalTree.hpp.

◆ getHigraNodeId()

NodeId mmcfilters::MorphologicalTree::getHigraNodeId ( NodeId  nodeId) const
inlinenoexcept

Returns the preserved imported Higra node id for one live tree node.

Returns InvalidNode when the original Higra node-id space is not preserved.

Definition at line 1374 of file MorphologicalTree.hpp.

◆ getIteratorBreadthFirstTraversal() [1/2]

BreadthFirstNodeRange mmcfilters::MorphologicalTree::getIteratorBreadthFirstTraversal ( ) const
inline

Returns a breadth-first traversal range rooted at the connected root.

Definition at line 2023 of file MorphologicalTree.hpp.

◆ getIteratorBreadthFirstTraversal() [2/2]

BreadthFirstNodeRange mmcfilters::MorphologicalTree::getIteratorBreadthFirstTraversal ( NodeId  rootNodeId) const
inline

Returns a breadth-first traversal range rooted at rootNodeId.

Definition at line 2030 of file MorphologicalTree.hpp.

◆ getLeaves()

std::vector< NodeId > mmcfilters::MorphologicalTree::getLeaves ( ) const
inline

Returns all live leaf nodes in the current hierarchy.

Definition at line 1551 of file MorphologicalTree.hpp.

◆ getLowestCommonAncestor()

NodeId mmcfilters::MorphologicalTree::getLowestCommonAncestor ( NodeId  u,
NodeId  v 
) const
inline

Returns the lowest common ancestor of u and v.

Definition at line 1951 of file MorphologicalTree.hpp.

◆ getMutationVersion()

std::size_t mmcfilters::MorphologicalTree::getMutationVersion ( ) const
inlinenoexcept

Returns the monotonic mutation counter used by read-only views.

Definition at line 1316 of file MorphologicalTree.hpp.

◆ getNextSibling()

NodeId mmcfilters::MorphologicalTree::getNextSibling ( NodeId  nodeId) const
inline

Returns the next sibling of nodeId, or InvalidNode.

Definition at line 1492 of file MorphologicalTree.hpp.

◆ getNodeIdSpaceSize()

int mmcfilters::MorphologicalTree::getNodeIdSpaceSize ( NodeIdSpace  outputSpace) const
inline

Returns the size of the requested node-id domain.

NodeIdSpace::HIGRA means the preserved imported Higra domain, not the compact domain that would be generated by exporting the current tree.

Definition at line 1358 of file MorphologicalTree.hpp.

◆ getNodeNumDescendants()

int mmcfilters::MorphologicalTree::getNodeNumDescendants ( NodeId  nodeId) const
inline

Returns the number of internal descendants of nodeId.

Definition at line 1444 of file MorphologicalTree.hpp.

◆ getNodeNumSiblings()

int mmcfilters::MorphologicalTree::getNodeNumSiblings ( NodeId  nodeId) const
inline

Returns the number of siblings of nodeId.

Definition at line 1454 of file MorphologicalTree.hpp.

◆ getNodeParent()

NodeId mmcfilters::MorphologicalTree::getNodeParent ( NodeId  nodeId) const
inline

Returns the direct parent of nodeId.

The root and detached nodes report themselves as parent.

Definition at line 1524 of file MorphologicalTree.hpp.

◆ getNodeSubtree()

SubtreeNodeRange mmcfilters::MorphologicalTree::getNodeSubtree ( NodeId  nodeId) const
inline

Returns a pre-order traversal range over the subtree of nodeId.

Definition at line 2055 of file MorphologicalTree.hpp.

◆ getNodeTimePostOrder()

int mmcfilters::MorphologicalTree::getNodeTimePostOrder ( NodeId  nodeId) const
inline

Returns the postorder time of nodeId in the cached DFS traversal.

Definition at line 1475 of file MorphologicalTree.hpp.

◆ getNodeTimePreOrder()

int mmcfilters::MorphologicalTree::getNodeTimePreOrder ( NodeId  nodeId) const
inline

Returns the preorder time of nodeId in the cached DFS traversal.

Definition at line 1466 of file MorphologicalTree.hpp.

◆ getNumChildren()

int mmcfilters::MorphologicalTree::getNumChildren ( NodeId  nodeId) const
inline

Returns the number of direct children of nodeId.

Definition at line 1436 of file MorphologicalTree.hpp.

◆ getNumColsOfImage()

int mmcfilters::MorphologicalTree::getNumColsOfImage ( ) const
inline

Returns the number of image columns in the attached 2D domain.

Definition at line 1676 of file MorphologicalTree.hpp.

◆ getNumFreeNodeSlots()

int mmcfilters::MorphologicalTree::getNumFreeNodeSlots ( ) const
inline

Returns the number of currently reusable node slots.

Definition at line 1418 of file MorphologicalTree.hpp.

◆ getNumHigraNodes()

int mmcfilters::MorphologicalTree::getNumHigraNodes ( ) const
inline

Returns the size of the preserved imported Higra node-id domain.

Exceptions
std::runtime_errorif the tree was not imported from Higra or if the preserved Higra node-id space was invalidated by an edit.

Definition at line 1345 of file MorphologicalTree.hpp.

◆ getNumInternalNodeSlots()

int mmcfilters::MorphologicalTree::getNumInternalNodeSlots ( ) const
inline

Returns the size of the dense internal-node id domain.

Some slots may currently be free and therefore not correspond to live nodes.

Definition at line 1332 of file MorphologicalTree.hpp.

◆ getNumLeafNodes()

int mmcfilters::MorphologicalTree::getNumLeafNodes ( ) const
inline

Counts the live nodes that currently have no children.

Definition at line 1423 of file MorphologicalTree.hpp.

◆ getNumNodes()

int mmcfilters::MorphologicalTree::getNumNodes ( ) const
inlinenoexcept

Returns the number of currently live nodes.

Definition at line 1580 of file MorphologicalTree.hpp.

◆ getNumProperParts()

int mmcfilters::MorphologicalTree::getNumProperParts ( NodeId  nodeId) const
inline

Returns the number of direct proper parts owned by nodeId.

Definition at line 1505 of file MorphologicalTree.hpp.

◆ getNumRowsOfImage()

int mmcfilters::MorphologicalTree::getNumRowsOfImage ( ) const
inline

Returns the number of image rows in the attached 2D domain.

Definition at line 1669 of file MorphologicalTree.hpp.

◆ getNumTotalProperParts()

int mmcfilters::MorphologicalTree::getNumTotalProperParts ( ) const
inline

Returns the size of the proper-part domain.

Definition at line 1337 of file MorphologicalTree.hpp.

◆ getPathBetweenNodes()

PathBetweenNodesRange mmcfilters::MorphologicalTree::getPathBetweenNodes ( NodeId  sourceNodeId,
NodeId  targetNodeId 
) const
inline

Returns the path that connects sourceNodeId and targetNodeId.

Definition at line 2046 of file MorphologicalTree.hpp.

◆ getPathToRootNodes()

PathToRootRange mmcfilters::MorphologicalTree::getPathToRootNodes ( NodeId  nodeId) const
inline

Returns the path from nodeId to the connected root.

Definition at line 2038 of file MorphologicalTree.hpp.

◆ getPostOrderNodes() [1/2]

PostOrderNodeRange mmcfilters::MorphologicalTree::getPostOrderNodes ( ) const
inline

Returns a post-order traversal range rooted at the connected root.

Definition at line 2008 of file MorphologicalTree.hpp.

◆ getPostOrderNodes() [2/2]

PostOrderNodeRange mmcfilters::MorphologicalTree::getPostOrderNodes ( NodeId  rootNodeId) const
inline

Returns a post-order traversal range rooted at rootNodeId.

Definition at line 2015 of file MorphologicalTree.hpp.

◆ getProperPartOwner()

NodeId mmcfilters::MorphologicalTree::getProperPartOwner ( NodeId  properPartId) const
inline

Returns the live node that directly owns properPartId.

Definition at line 1542 of file MorphologicalTree.hpp.

◆ getProperParts()

ProperPartsRange mmcfilters::MorphologicalTree::getProperParts ( NodeId  nodeId) const
inline

Returns a fail-fast range over the direct proper parts of nodeId.

Definition at line 1988 of file MorphologicalTree.hpp.

◆ getRoot()

NodeId mmcfilters::MorphologicalTree::getRoot ( ) const
inline

Returns the current hierarchy root.

Definition at line 1384 of file MorphologicalTree.hpp.

◆ getTreeOfShapesMaxTreeAdjacencyRadius()

double mmcfilters::MorphologicalTree::getTreeOfShapesMaxTreeAdjacencyRadius ( ) const
inline

Returns the auxiliary max-tree adjacency radius used by the ToS interpolation policy.

Definition at line 1645 of file MorphologicalTree.hpp.

◆ getTreeOfShapesMaxTreeAdjacencyRelation()

const AdjacencyRelation * mmcfilters::MorphologicalTree::getTreeOfShapesMaxTreeAdjacencyRelation ( ) const
inlinenoexcept

Returns the auxiliary max-tree adjacency relation used by the ToS interpolation policy.

Definition at line 1662 of file MorphologicalTree.hpp.

◆ getTreeOfShapesMinTreeAdjacencyRadius()

double mmcfilters::MorphologicalTree::getTreeOfShapesMinTreeAdjacencyRadius ( ) const
inline

Returns the auxiliary min-tree adjacency radius used by the ToS interpolation policy.

Definition at line 1635 of file MorphologicalTree.hpp.

◆ getTreeOfShapesMinTreeAdjacencyRelation()

const AdjacencyRelation * mmcfilters::MorphologicalTree::getTreeOfShapesMinTreeAdjacencyRelation ( ) const
inlinenoexcept

Returns the auxiliary min-tree adjacency relation used by the ToS interpolation policy.

Definition at line 1655 of file MorphologicalTree.hpp.

◆ getTreeType()

MorphologicalTreeKind mmcfilters::MorphologicalTree::getTreeType ( ) const
inlinenoexcept

Returns the current tree type.

Definition at line 1575 of file MorphologicalTree.hpp.

◆ hasAdjacencyRelation()

bool mmcfilters::MorphologicalTree::hasAdjacencyRelation ( ) const
inlinenoexcept

Tests whether an adjacency relation is attached to the tree.

Definition at line 1625 of file MorphologicalTree.hpp.

◆ hasChild()

bool mmcfilters::MorphologicalTree::hasChild ( NodeId  parentNodeId,
NodeId  childId 
) const
inline

Tests whether childId is a direct child of parentNodeId.

Definition at line 1513 of file MorphologicalTree.hpp.

◆ hasDetachedAliveNodes()

bool mmcfilters::MorphologicalTree::hasDetachedAliveNodes ( ) const
inlinenoexcept

Returns whether the tree currently contains alive detached nodes.

Detached alive nodes are self-parented nodes other than the connected root. They are allowed during explicit edit sessions but make the hierarchy a forest rather than a single rooted tree.

Definition at line 1603 of file MorphologicalTree.hpp.

◆ hasTreeOfShapesAdjacencyPolicy()

bool mmcfilters::MorphologicalTree::hasTreeOfShapesAdjacencyPolicy ( ) const
inlinenoexcept

Tests whether this image-built tree of shapes carries min/max auxiliary adjacency metadata.

Definition at line 1630 of file MorphologicalTree.hpp.

◆ isAlive()

bool mmcfilters::MorphologicalTree::isAlive ( NodeId  nodeId) const
inline

Tests whether a node slot currently represents a live node.

Definition at line 1399 of file MorphologicalTree.hpp.

◆ isAncestor()

bool mmcfilters::MorphologicalTree::isAncestor ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u is an ancestor of v.

Definition at line 1906 of file MorphologicalTree.hpp.

◆ isComparable()

bool mmcfilters::MorphologicalTree::isComparable ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u and v are comparable in the ancestry order.

Definition at line 1931 of file MorphologicalTree.hpp.

◆ isDescendant()

bool mmcfilters::MorphologicalTree::isDescendant ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u is a descendant of v.

Definition at line 1919 of file MorphologicalTree.hpp.

◆ isEditing()

bool mmcfilters::MorphologicalTree::isEditing ( ) const
inlinenoexcept

Tests whether a staged edit session is currently open.

Definition at line 1585 of file MorphologicalTree.hpp.

◆ isLeaf()

bool mmcfilters::MorphologicalTree::isLeaf ( NodeId  nodeId) const
inline

Tests whether nodeId has no direct children.

Definition at line 1500 of file MorphologicalTree.hpp.

◆ isNode()

bool mmcfilters::MorphologicalTree::isNode ( NodeId  nodeId) const
inlinenoexcept

Tests whether nodeId belongs to the internal-node id domain.

Definition at line 1389 of file MorphologicalTree.hpp.

◆ isProperPart()

bool mmcfilters::MorphologicalTree::isProperPart ( NodeId  id) const
inlinenoexcept

Tests whether id belongs to the proper-part domain.

Definition at line 1394 of file MorphologicalTree.hpp.

◆ isRoot()

bool mmcfilters::MorphologicalTree::isRoot ( NodeId  nodeId) const
inline

Tests whether nodeId is the current root.

Definition at line 1413 of file MorphologicalTree.hpp.

◆ isStrictAncestor()

bool mmcfilters::MorphologicalTree::isStrictAncestor ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u is a strict ancestor of v.

Definition at line 1936 of file MorphologicalTree.hpp.

◆ isStrictComparable()

bool mmcfilters::MorphologicalTree::isStrictComparable ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u and v are strictly comparable in the ancestry order.

Definition at line 1946 of file MorphologicalTree.hpp.

◆ isStrictDescendant()

bool mmcfilters::MorphologicalTree::isStrictDescendant ( NodeId  u,
NodeId  v 
) const
inline

Tests whether u is a strict descendant of v.

Definition at line 1941 of file MorphologicalTree.hpp.

◆ mergeNodeIntoParent()

void mmcfilters::MorphologicalTree::mergeNodeIntoParent ( NodeId  nodeId)
inline

Merges nodeId into its parent and releases the emptied slot.

This is a safe committed edit: children and direct proper parts are transferred to the parent before the node slot is released. The operation advances the tree mutation version and invalidates derived state.

Definition at line 2128 of file MorphologicalTree.hpp.

◆ pruneNode()

void mmcfilters::MorphologicalTree::pruneNode ( NodeId  nodeId)
inline

Prunes the subtree of nodeId, moving all its support to the parent.

This is a safe committed edit: it is a complete local operation and does not intentionally leave the tree in a staged disconnected state, but it still advances the tree mutation version and invalidates derived state.

Definition at line 2087 of file MorphologicalTree.hpp.

◆ requireMutationVersion()

void mmcfilters::MorphologicalTree::requireMutationVersion ( std::size_t  expectedVersion,
const char context 
) const
inline

Rejects stale read-only views that captured an older mutation version.

Definition at line 1321 of file MorphologicalTree.hpp.

◆ requireNotEditing()

void mmcfilters::MorphologicalTree::requireNotEditing ( const char context) const
inline

Rejects operations that require a committed connected topology.

Definition at line 1590 of file MorphologicalTree.hpp.

◆ validateConnectedRootedTree()

void mmcfilters::MorphologicalTree::validateConnectedRootedTree ( ) const
inline

Validates that the current structure is one connected rooted tree.

This validation is intended for edit-session commits and debug/invariant checks. It is intentionally stronger than the local runtime guards used by low-level mutators.

Definition at line 1697 of file MorphologicalTree.hpp.

◆ validateConnectedRootedTreeResult()

TreeValidationResult mmcfilters::MorphologicalTree::validateConnectedRootedTreeResult ( ) const
inlinenoexcept

Runs strong validation and returns the result instead of throwing.

Definition at line 1892 of file MorphologicalTree.hpp.

Friends And Related Symbol Documentation

◆ TreeEditor

Definition at line 122 of file MorphologicalTree.hpp.


The documentation for this class was generated from the following files: