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

Public facade for attribute computation. More...

#include <AttributeComputation.hpp>

Static Public Member Functions

template<std::floating_point Real = float>
static ComputedAttributeData< RealcomputeSingleTopologyAttribute (const MorphologicalTree &tree, AttributeOrGroup attr, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes one topology/support-only scalar attribute or group.
 
template<std::floating_point Real = float>
static ComputedAttributeData< RealcomputeTopologyAttributes (const MorphologicalTree &tree, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes several topology/support-only attributes or groups.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeSingleTopologyAttribute (const WeightedMorphologicalTree< T > &tree, AttributeOrGroup attr, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes one topology/support-only scalar attribute or group on a weighted owner.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeSingleTopologyAttribute (const WeightedTreeView< T > &tree, AttributeOrGroup attr, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes one topology/support-only scalar attribute or group on a weighted view.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeTopologyAttributes (const WeightedMorphologicalTree< T > &tree, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes several topology/support-only attributes or groups on a weighted owner.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeTopologyAttributes (const WeightedTreeView< T > &tree, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes several topology/support-only attributes or groups on a weighted view.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeSingleAttribute (const WeightedMorphologicalTree< T > &tree, AttributeOrGroup attr, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes a single scalar attribute or a full attribute group.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeSingleAttribute (const WeightedTreeView< T > &tree, AttributeOrGroup attr, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes a single scalar attribute or group on a non-owning weighted view.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeDataWithDelta< RealcomputeSingleAttributeWithDelta (const WeightedMorphologicalTree< T > &tree, Attribute attribute, AltitudeDiff< T > deltaStep, int radius, std::string padding="last-padding", NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes a delta-augmented version of one scalar attribute.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeDataWithDelta< RealcomputeSingleAttributeWithDelta (const WeightedTreeView< T > &tree, Attribute attribute, AltitudeDiff< T > deltaStep, int radius, std::string padding="last-padding", NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes a delta-augmented scalar attribute on a non-owning weighted view.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeAttributes (const WeightedMorphologicalTree< T > &tree, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes a heterogeneous set of scalar attributes and attribute groups in one coordinated run.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeAttributes (const WeightedTreeView< T > &tree, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes several scalar attributes and groups on a non-owning weighted view.
 
template<std::floating_point Real = float, AltitudeValue T>
static ComputedAttributeData< RealcomputeAttributesFromAltitudeSpan (const WeightedTreeView< T > &weighted, const std::vector< AttributeOrGroup > &attributes, NodeIdSpace outputSpace=NodeIdSpace::MORPHOLOGICAL_TREE)
 Computes attributes over an external altitude span.
 
template<std::floating_point Real = float, AltitudeValue T>
static std::vector< RealprojectNodeValuesToExportedHigra (const WeightedMorphologicalTree< T > &tree, const AttributeNames &attrNames, std::span< const Real > nodeValues)
 Projects an already computed internal-node attribute buffer to the compact Higra layout produced by TreeAltitudeAlgorithms::exportHigraHierarchy().
 
template<std::floating_point Real = float, AltitudeValue T>
static std::vector< RealprojectNodeValuesToExportedHigra (const WeightedMorphologicalTree< T > &tree, const AttributeNames &attrNames, const std::vector< Real > &nodeValues)
 Projects a vector-backed internal-node attribute buffer to exported Higra layout.
 
template<std::floating_point Real = float, AltitudeValue T>
static std::vector< RealprojectNodeValuesToExportedHigra (const WeightedTreeView< T > &tree, const AttributeNames &attrNames, std::span< const Real > nodeValues)
 Projects an internal-node attribute buffer from a weighted view to exported Higra layout.
 
template<std::floating_point Real = float, AltitudeValue T>
static std::vector< RealprojectNodeValuesToExportedHigra (const WeightedTreeView< T > &tree, const AttributeNames &attrNames, const std::vector< Real > &nodeValues)
 Projects a vector-backed internal-node attribute buffer from a weighted view to exported Higra layout.
 
template<std::floating_point Real = float, AltitudeValue T>
static ImagePtr< RealcomputeAttributeMapping (const WeightedMorphologicalTree< T > &tree, Attribute attribute)
 Projects a node attribute to a proper-part image in the original domain.
 
template<std::floating_point Real = float, AltitudeValue T>
static ImagePtr< RealcomputeAttributeMapping (const WeightedTreeView< T > &tree, Attribute attribute)
 Projects a node attribute from a weighted view to a proper-part image.
 

Detailed Description

Public facade for attribute computation.

This class is the public facade of the attribute framework. It provides:

The surrounding attribute subsystem is organised around:

Ordinary public attribute computation is expressed through WeightedMorphologicalTree<T> or WeightedTreeView<T>, so altitude-dependent requests always carry an explicit altitude contract. Plain MorphologicalTree remains public only for topology-only requests.

The canonical execution space is always the tree's dense internal node-id space. Projection to the preserved imported Higra space only happens at the boundary of the public API. Attribute value buffers are materialized as float by default; public methods can select any std::floating_point output Real type, with double supported by the packaged Python bindings. The public Real controls result storage. Ordinary facade computations run their internal attribute pipeline in double and cast only at the API boundary.

Definition at line 50 of file AttributeComputation.hpp.

Member Function Documentation

◆ computeAttributeMapping() [1/2]

template<std::floating_point Real, AltitudeValue T>
ImagePtr< Real > mmcfilters::AttributeComputation::computeAttributeMapping ( const WeightedMorphologicalTree< T > &  tree,
Attribute  attribute 
)
inlinestatic

Projects a node attribute to a proper-part image in the original domain.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree supplying topology and dense altitude data.
attributeScalar attribute to compute and map.
Returns
Image where each proper part receives its owner-node attribute value.

Definition at line 559 of file AttributeComputation.hpp.

◆ computeAttributeMapping() [2/2]

template<std::floating_point Real, AltitudeValue T>
ImagePtr< Real > mmcfilters::AttributeComputation::computeAttributeMapping ( const WeightedTreeView< T > &  tree,
Attribute  attribute 
)
inlinestatic

Projects a node attribute from a weighted view to a proper-part image.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view supplying topology and dense altitude data.
attributeScalar attribute to compute and map.
Returns
Image where each proper part receives its owner-node attribute value.

Definition at line 565 of file AttributeComputation.hpp.

◆ computeAttributes() [1/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeAttributes ( const WeightedMorphologicalTree< T > &  tree,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes a heterogeneous set of scalar attributes and attribute groups in one coordinated run.

Requests are routed to AttributePipeline. That path combines typed altitude kernels with the topology backend and returns a single layout containing exactly the requested scalar attributes.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree supplying topology and dense altitude data.
attributesScalar attributes and groups to compute.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.

Definition at line 486 of file AttributeComputation.hpp.

◆ computeAttributes() [2/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeAttributes ( const WeightedTreeView< T > &  tree,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes several scalar attributes and groups on a non-owning weighted view.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view supplying topology and dense altitude data.
attributesScalar attributes and groups to compute.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.
Exceptions
std::runtime_errorIf the borrowed topology changed since view construction.

Definition at line 491 of file AttributeComputation.hpp.

◆ computeAttributesFromAltitudeSpan()

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeAttributesFromAltitudeSpan ( const WeightedTreeView< T > &  weighted,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes attributes over an external altitude span.

Attributes that read altitude use templated kernels. Attributes that are independent from altitude are delegated to the topology backend, avoiding an altitude copy or conversion. WeightedTreeView<T> is the named non-owning form of the same topology plus external-altitude contract.

Template Parameters
TAltitude type borrowed by weighted.
Parameters
weightedWeighted view supplying topology and dense altitude data.
attributesScalar attributes and groups to compute.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.

Definition at line 497 of file AttributeComputation.hpp.

◆ computeSingleAttribute() [1/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeSingleAttribute ( const WeightedMorphologicalTree< T > &  tree,
AttributeOrGroup  attr,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes a single scalar attribute or a full attribute group.

Requests are routed through the typed weighted-tree attribute pipeline.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree supplying topology and dense altitude data.
attrScalar attribute or group to compute.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning attribute data and layout projected to outputSpace.

Definition at line 454 of file AttributeComputation.hpp.

◆ computeSingleAttribute() [2/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeSingleAttribute ( const WeightedTreeView< T > &  tree,
AttributeOrGroup  attr,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes a single scalar attribute or group on a non-owning weighted view.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view supplying topology and dense altitude data.
attrScalar attribute or group to compute.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning attribute data and layout projected to outputSpace.
Exceptions
std::runtime_errorIf the borrowed topology changed since view construction.

Definition at line 459 of file AttributeComputation.hpp.

◆ computeSingleAttributeWithDelta() [1/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeDataWithDelta< Real > mmcfilters::AttributeComputation::computeSingleAttributeWithDelta ( const WeightedMorphologicalTree< T > &  tree,
Attribute  attribute,
AltitudeDiff< T deltaStep,
int  radius,
std::string  padding = "last-padding",
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes a delta-augmented version of one scalar attribute.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree supplying topology and dense altitude data.
attributeScalar attribute to compute before delta sampling.
deltaStepTyped altitude distance between consecutive materialised offsets.
radiusMaximum signed ancestor/descendant offset to materialise.
paddingStrategy used when the requested offset leaves the valid ancestor/descendant chain.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning delta-augmented data and layout projected to outputSpace.

Definition at line 464 of file AttributeComputation.hpp.

◆ computeSingleAttributeWithDelta() [2/2]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeDataWithDelta< Real > mmcfilters::AttributeComputation::computeSingleAttributeWithDelta ( const WeightedTreeView< T > &  tree,
Attribute  attribute,
AltitudeDiff< T deltaStep,
int  radius,
std::string  padding = "last-padding",
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes a delta-augmented scalar attribute on a non-owning weighted view.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view supplying topology and dense altitude data.
attributeScalar attribute to compute before delta sampling.
deltaStepTyped altitude distance between consecutive materialised offsets.
radiusMaximum signed ancestor/descendant offset to materialise.
paddingStrategy used when the requested offset leaves the valid chain.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning delta-augmented data and layout projected to outputSpace.
Exceptions
std::runtime_errorIf the borrowed topology changed since view construction.

Definition at line 469 of file AttributeComputation.hpp.

◆ computeSingleTopologyAttribute() [1/3]

template<std::floating_point Real>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeSingleTopologyAttribute ( const MorphologicalTree tree,
AttributeOrGroup  attr,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes one topology/support-only scalar attribute or group.

Parameters
treeTopology whose dense internal NodeId domain indexes the result.
attrScalar attribute or group that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning attribute data and layout projected to outputSpace.
Exceptions
std::invalid_argumentIf attr requires altitude or outputSpace is unavailable for tree.

Definition at line 408 of file AttributeComputation.hpp.

◆ computeSingleTopologyAttribute() [2/3]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeSingleTopologyAttribute ( const WeightedMorphologicalTree< T > &  tree,
AttributeOrGroup  attr,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes one topology/support-only scalar attribute or group on a weighted owner.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree whose topology defines the node-id domain.
attrScalar attribute or group that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning attribute data and layout projected to outputSpace.

Definition at line 420 of file AttributeComputation.hpp.

◆ computeSingleTopologyAttribute() [3/3]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeSingleTopologyAttribute ( const WeightedTreeView< T > &  tree,
AttributeOrGroup  attr,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes one topology/support-only scalar attribute or group on a weighted view.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view whose topology defines the node-id domain.
attrScalar attribute or group that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning attribute data and layout projected to outputSpace.
Exceptions
std::runtime_errorIf the borrowed topology changed since view construction.

Definition at line 425 of file AttributeComputation.hpp.

◆ computeTopologyAttributes() [1/3]

template<std::floating_point Real>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeTopologyAttributes ( const MorphologicalTree tree,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes several topology/support-only attributes or groups.

Parameters
treeTopology whose dense internal NodeId domain indexes the result.
attributesScalar attributes and groups that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.
Exceptions
std::invalid_argumentIf any request requires altitude or the output space is unavailable for tree.

Definition at line 414 of file AttributeComputation.hpp.

◆ computeTopologyAttributes() [2/3]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeTopologyAttributes ( const WeightedMorphologicalTree< T > &  tree,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes several topology/support-only attributes or groups on a weighted owner.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree whose topology defines the node-id domain.
attributesScalar attributes and groups that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.

Definition at line 437 of file AttributeComputation.hpp.

◆ computeTopologyAttributes() [3/3]

template<std::floating_point Real, AltitudeValue T>
ComputedAttributeData< Real > mmcfilters::AttributeComputation::computeTopologyAttributes ( const WeightedTreeView< T > &  tree,
const std::vector< AttributeOrGroup > &  attributes,
NodeIdSpace  outputSpace = NodeIdSpace::MORPHOLOGICAL_TREE 
)
inlinestatic

Computes several topology/support-only attributes or groups on a weighted view.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view whose topology defines the node-id domain.
attributesScalar attributes and groups that must not require altitude.
outputSpaceNode-id space requested for the returned buffer.
Returns
Owning node-major attribute data projected to outputSpace.
Exceptions
std::runtime_errorIf the borrowed topology changed since view construction.

Definition at line 442 of file AttributeComputation.hpp.

◆ projectNodeValuesToExportedHigra() [1/4]

template<std::floating_point Real, AltitudeValue T>
std::vector< Real > mmcfilters::AttributeComputation::projectNodeValuesToExportedHigra ( const WeightedMorphologicalTree< T > &  tree,
const AttributeNames attrNames,
const std::vector< Real > &  nodeValues 
)
inlinestatic

Projects a vector-backed internal-node attribute buffer to exported Higra layout.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree defining the current exported Higra hierarchy.
attrNamesLayout of the input nodeValues columns.
nodeValuesDense internal-node buffer in row-major layout.
Returns
Row-major values in compact exported Higra layout.

Definition at line 515 of file AttributeComputation.hpp.

◆ projectNodeValuesToExportedHigra() [2/4]

template<std::floating_point Real, AltitudeValue T>
std::vector< Real > mmcfilters::AttributeComputation::projectNodeValuesToExportedHigra ( const WeightedMorphologicalTree< T > &  tree,
const AttributeNames attrNames,
std::span< const Real nodeValues 
)
inlinestatic

Projects an already computed internal-node attribute buffer to the compact Higra layout produced by TreeAltitudeAlgorithms::exportHigraHierarchy().

nodeValues must be row-major by dense internal NodeId, with one column per attribute described by attrNames. The exported buffer follows the compact Higra convention [proper parts | live internal nodes]. Unit proper-part rows are computed by the export projection path for each requested attribute, and internal-node rows are copied from nodeValues using the same layout helper as hierarchy export.

Template Parameters
TAltitude type owned by tree.
Parameters
treeWeighted tree defining the current exported Higra hierarchy.
attrNamesLayout of the input nodeValues columns.
nodeValuesDense internal-node buffer in row-major layout.
Returns
Row-major values in compact exported Higra layout.

Definition at line 507 of file AttributeComputation.hpp.

◆ projectNodeValuesToExportedHigra() [3/4]

template<std::floating_point Real, AltitudeValue T>
std::vector< Real > mmcfilters::AttributeComputation::projectNodeValuesToExportedHigra ( const WeightedTreeView< T > &  tree,
const AttributeNames attrNames,
const std::vector< Real > &  nodeValues 
)
inlinestatic

Projects a vector-backed internal-node attribute buffer from a weighted view to exported Higra layout.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view defining topology and unit-component altitude data.
attrNamesLayout of the input nodeValues columns.
nodeValuesDense internal-node buffer in row-major layout.
Returns
Row-major values in compact exported Higra layout.

Definition at line 551 of file AttributeComputation.hpp.

◆ projectNodeValuesToExportedHigra() [4/4]

template<std::floating_point Real, AltitudeValue T>
std::vector< Real > mmcfilters::AttributeComputation::projectNodeValuesToExportedHigra ( const WeightedTreeView< T > &  tree,
const AttributeNames attrNames,
std::span< const Real nodeValues 
)
inlinestatic

Projects an internal-node attribute buffer from a weighted view to exported Higra layout.

Template Parameters
TAltitude type borrowed by tree.
Parameters
treeWeighted view defining topology and unit-component altitude data.
attrNamesLayout of the input nodeValues columns.
nodeValuesDense internal-node buffer in row-major layout.
Returns
Row-major values in compact exported Higra layout.

Definition at line 523 of file AttributeComputation.hpp.


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