TTK
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ttk::ContourTree Class Reference

TTK processing package that computes the contour tree of scalar data and more (data segmentation, topological simplification, persistence diagrams, persistence curves, etc.). More...

#include <ContourTree.h>

Inheritance diagram for ttk::ContourTree:
ttk::SubLevelSetTree ttk::Debug ttk::BaseClass

Public Member Functions

 ContourTree ()
 
int build ()
 
const SubLevelSetTreegetMergeTree () const
 
int getPersistencePairs (std::vector< std::pair< std::pair< int, int >, double > > &pairs, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr) const override
 
int getPersistencePlot (std::vector< std::pair< double, int > > &plot, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
 
int getPersistenceDiagram (std::vector< std::pair< double, double > > &diagram, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
 
const SubLevelSetTreegetSplitTree () const
 
int maintainRegularVertices (const bool &onOff) override
 
int setVertexNeighbors (const std::vector< std::vector< int > > *vertexNeighbors)
 
int setVertexNeighbors (const int &vertexId, const std::vector< int > &neighborList)
 
int computeSkeleton (unsigned int arcResolution=3) override
 
int smoothSkeleton (unsigned int skeletonSmoothing) override
 
int clearSkeleton () override
 
int simplify (const double &simplificationThreshold, ContourTreeSimplificationMetric *metric=nullptr) override
 
- Public Member Functions inherited from ttk::SubLevelSetTree
 SubLevelSetTree ()
 
int build ()
 
int buildExtremumList (std::vector< int > &extremumList, const bool &isSubLevelSet=true)
 
bool buildPlanarLayout (const double &scaleX, const double &scaleY)
 
int buildSaddleList (std::vector< int > &vertexList) const
 
int clearArc (const int &vertexId0, const int &vertexId1)
 
int clearRegularNode (const int &vertexId)
 
int clearRoot (const int &vertexId)
 
int exportPersistenceCurve (const std::string &fileName="output.plot") const
 
int exportPersistenceDiagram (const std::string &fileName="output.plot") const
 
int exportToSvg (const std::string &fileName, const double &scaleX=1, const double &scaleY=1)
 
int exportToVtk (const std::string &fileName, const std::vector< float > *origin=nullptr, const std::vector< float > *voxelSize=nullptr)
 
int flush ()
 
const ArcgetArc (const int &arcId) const
 
const std::vector< int > * getExtremumList () const
 
const NodegetNode (const int &nodeId) const
 
const NodegetNodeDownNeighbor (const Node *n, const int &neighborId) const
 
const NodegetNodeDownNeighbor (const int &nodeId, const int &neighborId) const
 
const NodegetNodeUpNeighbor (const Node *n, const int &neighborId) const
 
const NodegetNodeUpNeighbor (const int &nodeId, const int &neighborId) const
 
double getNodeScalar (const int &nodeId) const
 
int getNumberOfArcs () const
 
int getNumberOfSuperArcs () const
 
int getNumberOfNodes () const
 
int getPersistenceDiagram (std::vector< std::pair< double, double > > &diagram, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
 
virtual int getPersistencePairs (std::vector< std::pair< std::pair< int, int >, double > > &pairs, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr) const
 
int getPersistencePlot (std::vector< std::pair< double, int > > &plot, std::vector< std::pair< std::pair< int, int >, double > > *persistencePairs=nullptr) const
 
const SuperArcgetSuperArc (const int &superArcId) const
 
int getVertexScalar (const int &vertexId, double &scalar)
 
const SuperArcgetVertexSuperArc (const int &vertexId) const
 
int getVertexSuperArcId (const int &vertexId) const
 
const NodegetVertexNode (const int &vertexId) const
 
int getVertexNodeId (const int &vertexId) const
 
bool isJoinTree () const
 
bool isSplitTree () const
 
bool isSosLowerThan (const int &vertexId0, const int &vertexId1) const
 
bool isSosHigherThan (const int &vertexId0, const int &vertexId1) const
 
virtual int maintainRegularVertices (const bool &onOff)
 
int moveRegularNode (const Node *n, const Node *oldDown, const Node *oldUp, const Node *newDown, const Node *newUp)
 
int print () const
 
void setMaximumList (std::vector< int > &maximumList)
 
void setMinimumList (std::vector< int > &minimumList)
 
void setNumberOfVertices (const int &vertexNumber)
 
void setTriangulation (const AbstractTriangulation *const triangulation)
 
void setVertexPositions (std::vector< std::vector< double > > *vertexPositions)
 
void setVertexScalars (const std::vector< real > *const vertexScalars)
 
void setVertexSoSoffsets (std::vector< int > *vertexSoSoffsets)
 
virtual int simplify (const double &simplificationThreshold, ContourTreeSimplificationMetric *metric=nullptr)
 
int sample (unsigned int samplingLevel=3)
 
int computeBarycenters ()
 
int getSkeletonScalars (const std::vector< double > &scalars, std::vector< std::vector< double > > &skeletonScalars) const
 
virtual int computeSkeleton (unsigned int arcResolution=3)
 
virtual int smoothSkeleton (unsigned int skeletonSmoothing)
 
virtual int clearSkeleton ()
 
- 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)
 
virtual int setWrapper (const Wrapper *wrapper)
 

Protected Member Functions

int combineTrees ()
 
int finalize ()
 
int finalizeSuperArc (const int &nodeId, const int &arcId)
 
bool isNodeEligible (const Node *n) const
 
- Protected Member Functions inherited from ttk::SubLevelSetTree
int appendRegularNode (const int &superArcId, const int &nodeId)
 
int closeSuperArc (const int &superArcId, const int &nodeId)
 
int exportNodeColorToVtk (const int &nodeId, std::ofstream &o)
 
int exportNodePosToVtk (const int &nodeId, const int &pointId, std::vector< int > &vertexIds, const std::vector< float > *origin, const std::vector< float > *voxelSize, std::ofstream &o)
 
int exportArcPosToVtk (const int &arcId, const int &pointId, std::vector< int > &vertexIds, const std::vector< float > *origin, const std::vector< float > *voxelSize, std::ofstream &o)
 
int makeArc (const int &nodeId0, const int &nodeId1)
 
int makeNode (const int &vertexId)
 
int openSuperArc (const int &nodeId)
 
- 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

SubLevelSetTree mergeTree_ {}
 
SubLevelSetTree splitTree_ {}
 
- Protected Attributes inherited from ttk::SubLevelSetTree
int vertexNumber_ {0}
 
bool maintainRegularVertices_ {true}
 
double minScalar_ {}
 
double maxScalar_ {}
 
const std::vector< real > * vertexScalars_ {}
 
std::vector< int > * vertexSoSoffsets_ {}
 
bool externalOffsets_ {false}
 
const AbstractTriangulationtriangulation_ {}
 
std::vector< int > * minimumList_ {}
 
std::vector< int > * maximumList_ {}
 
std::vector< NodenodeList_ {}
 
std::vector< NodeoriginalNodeList_ {}
 
std::vector< ArcarcList_ {}
 
std::vector< SuperArcsuperArcList_ {}
 
std::vector< SuperArcoriginalSuperArcList_ {}
 
std::vector< int > vertex2node_ {}
 
std::vector< int > vertex2superArc_ {}
 
std::vector< int > vertex2superArcNode_ {}
 
std::vector< std::vector< double > > * vertexPositions_ {}
 
bool isSkeletonComputed_ {false}
 
- 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 that computes the contour tree of scalar data and more (data segmentation, topological simplification, persistence diagrams, persistence curves, etc.).

Author
Julien Tierny julie.nosp@m.n.ti.nosp@m.erny@.nosp@m.lip6.nosp@m..fr
Date
July 2011
Warning
SimplexId (large large datasets). This class builds and runs with the new triangulation API (SimplexId) but may need adjustments when addressing more than integers (large datasets).

Related publication
"Computing contour trees in all dimensions"
Hamish Carr, Jack Snoeyink, Ulrike Axen
Proc. of ACM SODA 2000.

Definition at line 591 of file ContourTree.h.

Constructor & Destructor Documentation

◆ ContourTree()

ContourTree::ContourTree ( )

Definition at line 2312 of file ContourTree.cpp.

Member Function Documentation

◆ build()

int ContourTree::build ( )

Definition at line 2316 of file ContourTree.cpp.

◆ clearSkeleton()

int ContourTree::clearSkeleton ( )
overridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 2744 of file ContourTree.cpp.

◆ combineTrees()

int ContourTree::combineTrees ( )
protected

Definition at line 2427 of file ContourTree.cpp.

◆ computeSkeleton()

int ContourTree::computeSkeleton ( unsigned int  arcResolution = 3)
overridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 2696 of file ContourTree.cpp.

◆ finalize()

int ContourTree::finalize ( )
protected

Definition at line 2581 of file ContourTree.cpp.

◆ finalizeSuperArc()

int ContourTree::finalizeSuperArc ( const int &  nodeId,
const int &  arcId 
)
protected

Definition at line 2611 of file ContourTree.cpp.

◆ getMergeTree()

const SubLevelSetTree * ttk::ContourTree::getMergeTree ( ) const
inline

Definition at line 597 of file ContourTree.h.

◆ getPersistenceDiagram()

int ContourTree::getPersistenceDiagram ( std::vector< std::pair< double, double > > &  diagram,
std::vector< std::pair< std::pair< int, int >, double > > *  mergePairs = nullptr,
std::vector< std::pair< std::pair< int, int >, double > > *  splitPairs = nullptr,
std::vector< std::pair< std::pair< int, int >, double > > *  pairs = nullptr 
) const

Definition at line 2849 of file ContourTree.cpp.

◆ getPersistencePairs()

int ContourTree::getPersistencePairs ( std::vector< std::pair< std::pair< int, int >, double > > &  pairs,
std::vector< std::pair< std::pair< int, int >, double > > *  mergePairs = nullptr,
std::vector< std::pair< std::pair< int, int >, double > > *  splitPairs = nullptr 
) const
overridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 2768 of file ContourTree.cpp.

◆ getPersistencePlot()

int ContourTree::getPersistencePlot ( std::vector< std::pair< double, int > > &  plot,
std::vector< std::pair< std::pair< int, int >, double > > *  mergePairs = nullptr,
std::vector< std::pair< std::pair< int, int >, double > > *  splitPairs = nullptr,
std::vector< std::pair< std::pair< int, int >, double > > *  pairs = nullptr 
) const

Definition at line 2822 of file ContourTree.cpp.

◆ getSplitTree()

const SubLevelSetTree * ttk::ContourTree::getSplitTree ( ) const
inline

Definition at line 621 of file ContourTree.h.

◆ isNodeEligible()

bool ContourTree::isNodeEligible ( const Node n) const
protected

Definition at line 2652 of file ContourTree.cpp.

◆ maintainRegularVertices()

int ttk::ContourTree::maintainRegularVertices ( const bool &  onOff)
inlineoverridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 625 of file ContourTree.h.

◆ setVertexNeighbors() [1/2]

int ttk::ContourTree::setVertexNeighbors ( const int &  vertexId,
const std::vector< int > &  neighborList 
)

◆ setVertexNeighbors() [2/2]

int ttk::ContourTree::setVertexNeighbors ( const std::vector< std::vector< int > > *  vertexNeighbors)

◆ simplify()

int ContourTree::simplify ( const double &  simplificationThreshold,
ContourTreeSimplificationMetric metric = nullptr 
)
overridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 2883 of file ContourTree.cpp.

◆ smoothSkeleton()

int ContourTree::smoothSkeleton ( unsigned int  skeletonSmoothing)
overridevirtual

Reimplemented from ttk::SubLevelSetTree.

Definition at line 2720 of file ContourTree.cpp.

Member Data Documentation

◆ mergeTree_

SubLevelSetTree ttk::ContourTree::mergeTree_ {}
protected

Definition at line 653 of file ContourTree.h.

◆ splitTree_

SubLevelSetTree ttk::ContourTree::splitTree_ {}
protected

Definition at line 653 of file ContourTree.h.


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