TTK
Loading...
Searching...
No Matches
ttk::TopologicalSkeleton Class Reference

TTK processing package for the computation of Topological Skeleton of Vector Fields. The skeleton consists of four components: critical points, 1-separatrices(including orbits), 2-separatrices, and segmentation of where cells flow to and from. More...

#include <TopologicalSkeleton.h>

Inheritance diagram for ttk::TopologicalSkeleton:
ttk::Debug ttk::BaseClass ttkTopologicalSkeleton

Classes

struct  Output1Separatrices
 1-Separatrices point and cell data arrays More...
 
struct  Output2Separatrices
 2-Separatrices point and cell data arrays More...
 
struct  OutputCriticalPoints
 Critical points data arrays. More...
 
struct  OutputManifold
 Pointers to pre-allocated segmentation point data arrays. More...
 
struct  Separatrix
 

Public Member Functions

 TopologicalSkeleton ()
 
template<typename dataType, typename triangulationType>
int execute (OutputCriticalPoints &outCP, Output1Separatrices &outSeps1, Output2Separatrices &outSeps2, OutputManifold &outManifold, const dataType *const vectors, const size_t vectorsMTime, const triangulationType &triangulation)
 
void setComputeCriticalPoints (const bool state)
 
void setComputeSeparatrices1 (const bool doAscending, const bool doDescending, const bool doSaddleConnectors)
 
void setComputeCycles1 (const bool doAttracting, const bool doRepelling)
 
void setComputeSeparatrices2 (const bool doAscending, const bool doDescending)
 
void setComputeSegmentation (const bool doAscending, const bool doDescending, const bool doMorseSmale)
 
void setRunSimplification (const bool state)
 
void setFullOrbits (const bool fullOrbits)
 
void setSimplificationThreshold (const double threshold)
 
void preconditionTriangulation (AbstractTriangulation *const data)
 
- Public Member Functions inherited from ttk::Debug
 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 

Protected Member Functions

template<typename dataType, typename triangulationType>
int getDescendingSeparatrices1 (const std::vector< SimplexId > &saddles, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename dataType, typename triangulationType>
int getAscendingSeparatrices1 (const std::vector< SimplexId > &saddles, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getSaddleConnectors (const std::vector< SimplexId > &saddles2, std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getAttractingCycles1 (std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getRepellingCycles1 (std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename dataType, typename triangulationType>
int setSeparatrices1 (Output1Separatrices &outSeps1, const std::vector< Separatrix > &separatrices, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getDescendingSeparatrices2 (const std::vector< SimplexId > &saddles2, std::vector< Separatrix > &separatrices, std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
template<typename triangulationType>
int setDescendingSeparatrices2 (Output2Separatrices &outSeps2, const std::vector< Separatrix > &separatrices, const std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getDualPolygon (const SimplexId edgeId, SimplexId *const polygon, const size_t polSize, const triangulationType &triangulation) const
 
template<typename triangulationType>
int sortDualPolygonVertices (SimplexId *const polygon, const size_t polSize, const triangulationType &triangulation) const
 
template<typename triangulationType>
int getAscendingSeparatrices2 (const std::vector< SimplexId > &saddles1, std::vector< Separatrix > &separatrices, std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
template<typename triangulationType>
int setAscendingSeparatrices2 (Output2Separatrices &outSeps2, const std::vector< Separatrix > &separatrices, const std::vector< std::vector< SimplexId > > &separatricesSaddles, const triangulationType &triangulation) const
 
void flattenSeparatricesVectors (std::vector< std::vector< Separatrix > > &separatrices) const
 Flatten the vectors of vectors into their first component.
 
template<typename triangulationType>
int setAscendingSegmentation (const std::vector< SimplexId > &maxima, std::vector< Separatrix > &repellingOrbits, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
template<typename triangulationType>
int setDescendingSegmentation (const std::vector< SimplexId > &minima, std::vector< Separatrix > &attractingOrbits, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
template<typename triangulationType>
int setFinalSegmentation (const SimplexId numberOfMaxima, const SimplexId *const ascendingManifold, const SimplexId *const descendingManifold, SimplexId *const morseSmaleManifold, const triangulationType &triangulation) const
 
- Protected Member Functions inherited from ttk::Debug
int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 

Protected Attributes

VectorSimplification simplifierField_ {}
 
bool ComputeCriticalPoints {true}
 
bool ComputeAscendingSeparatrices1 {true}
 
bool ComputeDescendingSeparatrices1 {true}
 
bool ComputeSaddleConnectors {false}
 
bool ComputeAttractingCycles1 {true}
 
bool ComputeRepellingCycles1 {true}
 
bool ComputeAscendingSeparatrices2 {false}
 
bool ComputeDescendingSeparatrices2 {false}
 
bool ComputeAscendingSegmentation {true}
 
bool ComputeDescendingSegmentation {true}
 
bool ComputeFinalSegmentation {true}
 
bool RunSimplification {false}
 
double SimplificationThreshold {}
 
bool ReverseFullOrbit {true}
 
- Protected Attributes inherited from ttk::Debug
int debugLevel_
 
std::string debugMsgPrefix_
 
std::string debugMsgNamePrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 

Additional Inherited Members

- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

TTK processing package for the computation of Topological Skeleton of Vector Fields. The skeleton consists of four components: critical points, 1-separatrices(including orbits), 2-separatrices, and segmentation of where cells flow to and from.

Author
Tanner Finken finke.nosp@m.nt@a.nosp@m.rizon.nosp@m.a.ed.nosp@m.u
Joshua A. Levine josh@.nosp@m.cs.a.nosp@m.rizon.nosp@m.a.ed.nosp@m.u
Date
Summer 2024.

The code implementation is largely based on the MorseSmaleComplex filter. Additionally, the user is allowed to specify a threshold to simplify down to a certain number of critical points in the DiscreteVectorField.

See also
ttk::MorseSmaleComplex
ttk::dcvf::DiscreteVectorField
ttk::VectorSimplification

Related publication
"Localized Evaluation for Constructing Discrete Vector Fields"
Tanner Finken, Julien Tierny, Joshua A. Levine
IEEE VIS 2024.

See also
ttk::TopologicalSkeleton

Online examples:

Definition at line 43 of file TopologicalSkeleton.h.

Constructor & Destructor Documentation

◆ TopologicalSkeleton()

ttk::TopologicalSkeleton::TopologicalSkeleton ( )

Definition at line 3 of file TopologicalSkeleton.cpp.

Member Function Documentation

◆ execute()

template<typename dataType, typename triangulationType>
int ttk::TopologicalSkeleton::execute ( OutputCriticalPoints & outCP,
Output1Separatrices & outSeps1,
Output2Separatrices & outSeps2,
OutputManifold & outManifold,
const dataType *const vectors,
const size_t vectorsMTime,
const triangulationType & triangulation )
inline

Main function for computing the Topological Skeleton.

Precondition
TopologicalSkeleton::preconditionTriangulation must be called prior to this.

Definition at line 401 of file TopologicalSkeleton.h.

◆ flattenSeparatricesVectors()

void ttk::TopologicalSkeleton::flattenSeparatricesVectors ( std::vector< std::vector< Separatrix > > & separatrices) const
protected

Flatten the vectors of vectors into their first component.

Definition at line 7 of file TopologicalSkeleton.cpp.

◆ getAscendingSeparatrices1()

template<typename dataType, typename triangulationType>
int ttk::TopologicalSkeleton::getAscendingSeparatrices1 ( const std::vector< SimplexId > & saddles,
std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the ascending 1-separatrices by reading into the discrete vector field.

Definition at line 668 of file TopologicalSkeleton.h.

◆ getAscendingSeparatrices2()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getAscendingSeparatrices2 ( const std::vector< SimplexId > & saddles1,
std::vector< Separatrix > & separatrices,
std::vector< std::vector< SimplexId > > & separatricesSaddles,
const triangulationType & triangulation ) const
protected

Compute the 2-separatrices by reading into the discrete vector field from the minima.

Definition at line 1106 of file TopologicalSkeleton.h.

◆ getAttractingCycles1()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getAttractingCycles1 ( std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the attracting 1-cycles by reading into the discrete vector field.

Definition at line 790 of file TopologicalSkeleton.h.

◆ getDescendingSeparatrices1()

template<typename dataType, typename triangulationType>
int ttk::TopologicalSkeleton::getDescendingSeparatrices1 ( const std::vector< SimplexId > & saddles,
std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the descending 1-separatrices by reading into the discrete vector field.

Definition at line 618 of file TopologicalSkeleton.h.

◆ getDescendingSeparatrices2()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getDescendingSeparatrices2 ( const std::vector< SimplexId > & saddles2,
std::vector< Separatrix > & separatrices,
std::vector< std::vector< SimplexId > > & separatricesSaddles,
const triangulationType & triangulation ) const
protected

Compute the 2-separatrices by reading into the discrete vector field from the maxima.

Definition at line 1147 of file TopologicalSkeleton.h.

◆ getDualPolygon()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getDualPolygon ( const SimplexId edgeId,
SimplexId *const polygon,
const size_t polSize,
const triangulationType & triangulation ) const
protected

Find all tetras in the star of edgeId

(primal: star of edgeId -> dual: vertices of polygon)

Definition at line 1190 of file TopologicalSkeleton.h.

◆ getRepellingCycles1()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getRepellingCycles1 ( std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the repelling 1-cycles by reading into the discrete vector field.

Definition at line 873 of file TopologicalSkeleton.h.

◆ getSaddleConnectors()

template<typename triangulationType>
int ttk::TopologicalSkeleton::getSaddleConnectors ( const std::vector< SimplexId > & saddles2,
std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the saddle-connectors by reading into the discrete vector field.

Definition at line 731 of file TopologicalSkeleton.h.

◆ preconditionTriangulation()

void ttk::TopologicalSkeleton::preconditionTriangulation ( AbstractTriangulation *const data)
inline

Set the input triangulation and preprocess the needed mesh traversal queries.

Definition at line 200 of file TopologicalSkeleton.h.

◆ setAscendingSegmentation()

template<typename triangulationType>
int ttk::TopologicalSkeleton::setAscendingSegmentation ( const std::vector< SimplexId > & maxima,
std::vector< Separatrix > & repellingOrbits,
SimplexId *const morseSmaleManifold,
const triangulationType & triangulation ) const
protected

Compute the ascending manifold of the 'sources' (maxima for gradient fields).

Definition at line 1571 of file TopologicalSkeleton.h.

◆ setAscendingSeparatrices2()

template<typename triangulationType>
int ttk::TopologicalSkeleton::setAscendingSeparatrices2 ( Output2Separatrices & outSeps2,
const std::vector< Separatrix > & separatrices,
const std::vector< std::vector< SimplexId > > & separatricesSaddles,
const triangulationType & triangulation ) const
protected

Compute the geometrical embedding of the ascending 2-separatrices.

Definition at line 1241 of file TopologicalSkeleton.h.

◆ setComputeCriticalPoints()

void ttk::TopologicalSkeleton::setComputeCriticalPoints ( const bool state)
inline

Enable/Disable computation of the geometrical embedding of the critical points.

Definition at line 130 of file TopologicalSkeleton.h.

◆ setComputeCycles1()

void ttk::TopologicalSkeleton::setComputeCycles1 ( const bool doAttracting,
const bool doRepelling )
inline

Enable/Disable computation of geometrical embedding of 1-cycles

Definition at line 148 of file TopologicalSkeleton.h.

◆ setComputeSegmentation()

void ttk::TopologicalSkeleton::setComputeSegmentation ( const bool doAscending,
const bool doDescending,
const bool doMorseSmale )
inline

Enable/Disable computation of the geometrical embedding of the manifolds of the critical points.

Definition at line 166 of file TopologicalSkeleton.h.

◆ setComputeSeparatrices1()

void ttk::TopologicalSkeleton::setComputeSeparatrices1 ( const bool doAscending,
const bool doDescending,
const bool doSaddleConnectors )
inline

Enable/Disable computation of the geometrical embedding of the 1-separatrices.

Definition at line 137 of file TopologicalSkeleton.h.

◆ setComputeSeparatrices2()

void ttk::TopologicalSkeleton::setComputeSeparatrices2 ( const bool doAscending,
const bool doDescending )
inline

Enable/Disable computation of the geometrical embedding of the 2-separatrices (disabled by default).

Definition at line 157 of file TopologicalSkeleton.h.

◆ setDescendingSegmentation()

template<typename triangulationType>
int ttk::TopologicalSkeleton::setDescendingSegmentation ( const std::vector< SimplexId > & minima,
std::vector< Separatrix > & attractingOrbits,
SimplexId *const morseSmaleManifold,
const triangulationType & triangulation ) const
protected

Compute the descending manifold of the 'sinks' (minima for gradient fields).

Definition at line 1702 of file TopologicalSkeleton.h.

◆ setDescendingSeparatrices2()

template<typename triangulationType>
int ttk::TopologicalSkeleton::setDescendingSeparatrices2 ( Output2Separatrices & outSeps2,
const std::vector< Separatrix > & separatrices,
const std::vector< std::vector< SimplexId > > & separatricesSaddles,
const triangulationType & triangulation ) const
protected

Compute the geometrical embedding of the descending 2-separatrices.

Definition at line 1424 of file TopologicalSkeleton.h.

◆ setFinalSegmentation()

template<typename triangulationType>
int ttk::TopologicalSkeleton::setFinalSegmentation ( const SimplexId numberOfMaxima,
const SimplexId *const ascendingManifold,
const SimplexId *const descendingManifold,
SimplexId *const morseSmaleManifold,
const triangulationType & triangulation ) const
protected

Compute the final combinatorial Morse-Smale complex segmentation(intersection of outward and inward flowing segmentation).

Definition at line 1787 of file TopologicalSkeleton.h.

◆ setFullOrbits()

void ttk::TopologicalSkeleton::setFullOrbits ( const bool fullOrbits)
inline

Definition at line 183 of file TopologicalSkeleton.h.

◆ setRunSimplification()

void ttk::TopologicalSkeleton::setRunSimplification ( const bool state)
inline

Enable/Disable post-processing vector field reversal of the (saddle,...,saddle) vpaths under a given persistence threshold (disabled by default).

Definition at line 179 of file TopologicalSkeleton.h.

◆ setSeparatrices1()

template<typename dataType, typename triangulationType>
int ttk::TopologicalSkeleton::setSeparatrices1 ( Output1Separatrices & outSeps1,
const std::vector< Separatrix > & separatrices,
const triangulationType & triangulation ) const
protected

Compute the geometrical embedding of the 1-separatrices.

Definition at line 982 of file TopologicalSkeleton.h.

◆ setSimplificationThreshold()

void ttk::TopologicalSkeleton::setSimplificationThreshold ( const double threshold)
inline

Set the threshold value for post-processing of (saddle,...,saddle) vpaths vector field reversal (default value is 0.0).

Definition at line 192 of file TopologicalSkeleton.h.

◆ sortDualPolygonVertices()

template<typename triangulationType>
int ttk::TopologicalSkeleton::sortDualPolygonVertices ( SimplexId *const polygon,
const size_t polSize,
const triangulationType & triangulation ) const
protected

Sort the polygon vertices to be clockwise

Definition at line 1206 of file TopologicalSkeleton.h.

Member Data Documentation

◆ ComputeAscendingSegmentation

bool ttk::TopologicalSkeleton::ComputeAscendingSegmentation {true}
protected

Definition at line 386 of file TopologicalSkeleton.h.

◆ ComputeAscendingSeparatrices1

bool ttk::TopologicalSkeleton::ComputeAscendingSeparatrices1 {true}
protected

Definition at line 379 of file TopologicalSkeleton.h.

◆ ComputeAscendingSeparatrices2

bool ttk::TopologicalSkeleton::ComputeAscendingSeparatrices2 {false}
protected

Definition at line 384 of file TopologicalSkeleton.h.

◆ ComputeAttractingCycles1

bool ttk::TopologicalSkeleton::ComputeAttractingCycles1 {true}
protected

Definition at line 382 of file TopologicalSkeleton.h.

◆ ComputeCriticalPoints

bool ttk::TopologicalSkeleton::ComputeCriticalPoints {true}
protected

Definition at line 378 of file TopologicalSkeleton.h.

◆ ComputeDescendingSegmentation

bool ttk::TopologicalSkeleton::ComputeDescendingSegmentation {true}
protected

Definition at line 387 of file TopologicalSkeleton.h.

◆ ComputeDescendingSeparatrices1

bool ttk::TopologicalSkeleton::ComputeDescendingSeparatrices1 {true}
protected

Definition at line 380 of file TopologicalSkeleton.h.

◆ ComputeDescendingSeparatrices2

bool ttk::TopologicalSkeleton::ComputeDescendingSeparatrices2 {false}
protected

Definition at line 385 of file TopologicalSkeleton.h.

◆ ComputeFinalSegmentation

bool ttk::TopologicalSkeleton::ComputeFinalSegmentation {true}
protected

Definition at line 388 of file TopologicalSkeleton.h.

◆ ComputeRepellingCycles1

bool ttk::TopologicalSkeleton::ComputeRepellingCycles1 {true}
protected

Definition at line 383 of file TopologicalSkeleton.h.

◆ ComputeSaddleConnectors

bool ttk::TopologicalSkeleton::ComputeSaddleConnectors {false}
protected

Definition at line 381 of file TopologicalSkeleton.h.

◆ ReverseFullOrbit

bool ttk::TopologicalSkeleton::ReverseFullOrbit {true}
protected

Definition at line 392 of file TopologicalSkeleton.h.

◆ RunSimplification

bool ttk::TopologicalSkeleton::RunSimplification {false}
protected

Definition at line 390 of file TopologicalSkeleton.h.

◆ SimplificationThreshold

double ttk::TopologicalSkeleton::SimplificationThreshold {}
protected

Definition at line 391 of file TopologicalSkeleton.h.

◆ simplifierField_

VectorSimplification ttk::TopologicalSkeleton::simplifierField_ {}
protected

Definition at line 376 of file TopologicalSkeleton.h.


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