mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
MorphologicalTreeSemantics.hpp File Reference

Immutable scientific metadata attached to a morphological tree. More...

#include "../utils/Common.hpp"
#include "../utils/RegularGridAdjacency2D.hpp"
#include <utility>
#include <stdexcept>
#include <variant>
Include dependency graph for MorphologicalTreeSemantics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mmcfilters::NoConstructionContext
 Explicitly records that no construction context is available. More...
 
struct  mmcfilters::SharedAdjacencyContext
 Records one adjacency shared by both construction polarities. More...
 
struct  mmcfilters::SaturatedResidualContext
 Records the shared adjacency and infinity pixel of a saturated residual construction. More...
 
struct  mmcfilters::ComplementaryAdjacencies
 Ordered pair of complementary minimum and maximum adjacencies. More...
 
struct  mmcfilters::SelfDualSpanImmersion
 Selects the self-dual span-valued tree-of-shapes immersion. More...
 
struct  mmcfilters::CanonicalComplementaryGridImmersion
 Selects a canonical complementary-grid immersion without binding a domain. More...
 
struct  mmcfilters::ComplementaryGridImmersion
 Selects the optimized complementary-grid immersion. More...
 
struct  mmcfilters::TopographicConvention
 Complete discrete convention retained by a tree-of-shapes result. More...
 
struct  mmcfilters::MorphologicalTreeSemantics
 Immutable scientific interpretation attached to one morphological tree. More...
 

Typedefs

using mmcfilters::TreeOfShapesImmersion = std::variant< CanonicalComplementaryGridImmersion, ComplementaryGridImmersion, SelfDualSpanImmersion >
 Tagged tree-of-shapes immersion family.
 
using mmcfilters::MorphologicalTreeConstructionContext = std::variant< NoConstructionContext, SharedAdjacencyContext, SaturatedResidualContext, TopographicConvention >
 Tagged construction context retained by morphological-tree semantics.
 

Enumerations

enum class  mmcfilters::MorphologicalTreeKind {
  Generic , MaxTree , MinTree , TreeOfShapes ,
  UnrestrictedResidualTree , SaturatedResidualTree
}
 Declared construction family of one morphological tree. More...
 
enum class  mmcfilters::NodeAltitudeOrder { Increasing , Decreasing , Unconstrained }
 Global ordering constraint of node altitudes along parent-child arcs. More...
 
enum class  mmcfilters::ComplementaryPairing { Min4Max8 , Min8Max4 }
 Canonical ordered pairing of complementary 4- and 8-connectivities. More...
 
enum class  mmcfilters::TopographicDomainExtension { ExteriorRing , None }
 Relation between the source pixel domain and active topographic domain. More...
 
enum class  mmcfilters::TopographicAltitudeEncoding { UInt8 , ExactDoubled }
 Scale in which tree-of-shapes node altitudes are published. More...
 

Functions

TopographicConvention mmcfilters::selfDualSpanConvention (TopographicDomainExtension domainExtension=TopographicDomainExtension::ExteriorRing, PixelId infinityPixel=0, TopographicAltitudeEncoding altitudeEncoding=TopographicAltitudeEncoding::ExactDoubled)
 Builds a self-dual span convention in one call.
 
NodeAltitudeOrder mmcfilters::defaultNodeAltitudeOrder (MorphologicalTreeKind kind) noexcept
 Returns the conventional node-altitude order of a declared tree kind.
 
MorphologicalTreeSemantics mmcfilters::makeMorphologicalTreeSemantics (MorphologicalTreeKind kind, MorphologicalTreeConstructionContext constructionContext=NoConstructionContext{})
 Constructs semantics using the conventional altitude order of kind.
 
void mmcfilters::validateMorphologicalTreeSemantics (const MorphologicalTreeSemantics &semantics)
 Validates the scientific compatibility of a semantics descriptor.
 

Detailed Description

Immutable scientific metadata attached to a morphological tree.

Definition in file MorphologicalTreeSemantics.hpp.

Typedef Documentation

◆ MorphologicalTreeConstructionContext

using mmcfilters::MorphologicalTreeConstructionContext = typedef std::variant<NoConstructionContext, SharedAdjacencyContext, SaturatedResidualContext, TopographicConvention>

Tagged construction context retained by morphological-tree semantics.

Definition at line 125 of file MorphologicalTreeSemantics.hpp.

◆ TreeOfShapesImmersion

using mmcfilters::TreeOfShapesImmersion = typedef std::variant<CanonicalComplementaryGridImmersion, ComplementaryGridImmersion, SelfDualSpanImmersion>

Tagged tree-of-shapes immersion family.

Definition at line 80 of file MorphologicalTreeSemantics.hpp.

Enumeration Type Documentation

◆ ComplementaryPairing

Canonical ordered pairing of complementary 4- and 8-connectivities.

Definition at line 61 of file MorphologicalTreeSemantics.hpp.

◆ MorphologicalTreeKind

Declared construction family of one morphological tree.

Definition at line 18 of file MorphologicalTreeSemantics.hpp.

◆ NodeAltitudeOrder

enum class mmcfilters::NodeAltitudeOrder
strong

Global ordering constraint of node altitudes along parent-child arcs.

Enumerator
Increasing 

Every alive parent-child arc satisfies nodeAltitude(parent) < nodeAltitude(child).

Decreasing 

Every alive parent-child arc satisfies nodeAltitude(parent) > nodeAltitude(child).

Unconstrained 

No global parent-child altitude order is declared.

Definition at line 28 of file MorphologicalTreeSemantics.hpp.

◆ TopographicAltitudeEncoding

Scale in which tree-of-shapes node altitudes are published.

UInt8 publishes source gray levels unchanged. It is exact for complementary-grid immersions and for a self-dual span immersion without an exterior ring, because neither case exposes half levels in the active domain. ExactDoubled publishes doubled units, where a source level v is represented by 2 * v and odd values represent half levels that a self-dual span immersion with an exterior ring can introduce.

Definition at line 95 of file MorphologicalTreeSemantics.hpp.

◆ TopographicDomainExtension

Relation between the source pixel domain and active topographic domain.

Definition at line 83 of file MorphologicalTreeSemantics.hpp.

Function Documentation

◆ defaultNodeAltitudeOrder()

NodeAltitudeOrder mmcfilters::defaultNodeAltitudeOrder ( MorphologicalTreeKind  kind)
inlinenoexcept

Returns the conventional node-altitude order of a declared tree kind.

Parameters
kindDeclared tree kind.
Returns
Conventional altitude order.

Definition at line 141 of file MorphologicalTreeSemantics.hpp.

◆ makeMorphologicalTreeSemantics()

MorphologicalTreeSemantics mmcfilters::makeMorphologicalTreeSemantics ( MorphologicalTreeKind  kind,
MorphologicalTreeConstructionContext  constructionContext = NoConstructionContext{} 
)
inline

Constructs semantics using the conventional altitude order of kind.

Parameters
kindDeclared tree kind.
constructionContextRetained typed context.
Returns
Coherent semantics descriptor.

Definition at line 157 of file MorphologicalTreeSemantics.hpp.

◆ selfDualSpanConvention()

TopographicConvention mmcfilters::selfDualSpanConvention ( TopographicDomainExtension  domainExtension = TopographicDomainExtension::ExteriorRing,
PixelId  infinityPixel = 0,
TopographicAltitudeEncoding  altitudeEncoding = TopographicAltitudeEncoding::ExactDoubled 
)
inline

Builds a self-dual span convention in one call.

The immersion, extension, and encoding of a self-dual span construction are coupled: the exterior ring carries the boundary reference level, which admits only TopographicAltitudeEncoding::ExactDoubled. Gathering them here keeps call sites short and the combination coherent.

Parameters
domainExtensionActive-domain extension convention.
infinityPixelDeclared infinity pixel in the active topographic domain.
altitudeEncodingPublished node-altitude scale.
Returns
A self-dual span convention carrying the requested fields.

Definition at line 118 of file MorphologicalTreeSemantics.hpp.

◆ validateMorphologicalTreeSemantics()

void mmcfilters::validateMorphologicalTreeSemantics ( const MorphologicalTreeSemantics semantics)
inline

Validates the scientific compatibility of a semantics descriptor.

NoConstructionContext is valid for every kind because it explicitly records unavailable provenance. Every concrete context is restricted to the construction families whose parameters it represents.

Parameters
semanticsDescriptor to validate.

Definition at line 171 of file MorphologicalTreeSemantics.hpp.