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

#include <MergeTreeTemporalReduction.h>

Inheritance diagram for ttk::MergeTreeTemporalReduction:
ttk::Debug ttk::MergeTreeBase ttk::BaseClass ttk::Debug ttk::BaseClass ttkMergeTreeTemporalReduction

Public Member Functions

 MergeTreeTemporalReduction ()
 
void setRemovalPercentage (double rs)
 
void setUseL2Distance (bool useL2)
 
template<class dataType >
dataType computeL2Distance (std::vector< dataType > &img1, std::vector< dataType > &img2, bool emptyFieldDistance=false)
 
template<class dataType >
std::vector< dataType > computeL2Barycenter (std::vector< dataType > &img1, std::vector< dataType > &img2, double alpha)
 
template<class dataType >
dataType computeDistance (ftm::MergeTree< dataType > &mTree1, ftm::MergeTree< dataType > &mTree2, bool emptyTreeDistance=false)
 
template<class dataType >
ftm::MergeTree< dataType > computeBarycenter (ftm::MergeTree< dataType > &mTree1, ftm::MergeTree< dataType > &mTree2, double alpha)
 
double computeAlpha (int index1, int middleIndex, int index2)
 
template<class dataType >
void temporalSubsampling (std::vector< ftm::MergeTree< dataType > > &mTrees, std::vector< int > &removed, std::vector< ftm::MergeTree< dataType > > &barycenters, std::vector< std::vector< dataType > > &barycentersL2)
 
template<class dataType >
std::vector< int > execute (std::vector< ftm::MergeTree< dataType > > &mTrees, std::vector< double > &emptyTreeDistances, std::vector< ftm::MergeTree< dataType > > &allMT)
 
- 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)
 
- Public Member Functions inherited from ttk::MergeTreeBase
 MergeTreeBase ()
 
void setAssignmentSolver (int assignmentSolver)
 
void setEpsilon1UseFarthestSaddle (bool b)
 
void setEpsilonTree1 (double epsilon)
 
void setEpsilonTree2 (double epsilon)
 
void setEpsilon2Tree1 (double epsilon)
 
void setEpsilon2Tree2 (double epsilon)
 
void setEpsilon3Tree1 (double epsilon)
 
void setEpsilon3Tree2 (double epsilon)
 
void setPersistenceThreshold (double pt)
 
void setParallelize (bool para)
 
void setNodePerTask (int npt)
 
void setBranchDecomposition (bool useBD)
 
void setNormalizedWasserstein (bool normalizedWasserstein)
 
void setKeepSubtree (bool keepSubtree)
 
void setNonMatchingWeight (double weight)
 
void setBarycenterMergeTree (bool imt)
 
void setDistanceSquaredRoot (bool distanceSquaredRoot)
 
void setUseMinMaxPair (bool useMinMaxPair)
 
void setDeleteMultiPersPairs (bool deleteMultiPersPairsT)
 
void setCleanTree (bool clean)
 
void setIsPersistenceDiagram (bool isPD)
 
std::vector< std::vector< int > > getTreesNodeCorr ()
 
double mixDistancesMinMaxPairWeight (bool isFirstInput)
 
double mixDistancesWeight (bool isFirstInput)
 
template<class dataType >
double mixDistances (dataType distance1, dataType distance2)
 
template<class dataType >
void mixDistancesMatrix (std::vector< std::vector< dataType > > &distanceMatrix, std::vector< std::vector< dataType > > &distanceMatrix2)
 
template<class dataType >
void mergeSaddle (ftm::FTMTree_MT *tree, double epsilon, std::vector< std::vector< ftm::idNode > > &treeNodeMerged, bool mergeByPersistence=false)
 
template<class dataType >
void persistenceMerging (ftm::FTMTree_MT *tree, double epsilon2, double epsilon3=100)
 
template<class dataType >
void keepMostImportantPairs (ftm::FTMTree_MT *tree, int n, bool useBD)
 
template<class dataType >
void persistenceThresholding (ftm::FTMTree_MT *tree, double persistenceThresholdT, std::vector< ftm::idNode > &deletedNodes)
 
template<class dataType >
void persistenceThresholding (ftm::FTMTree_MT *tree, std::vector< ftm::idNode > &deletedNodes)
 
template<class dataType >
void persistenceThresholding (ftm::FTMTree_MT *tree, double persistenceThresholdT)
 
template<class dataType >
void persistenceThresholding (ftm::FTMTree_MT *tree)
 
template<class dataType >
void verifyOrigins (ftm::FTMTree_MT *tree)
 
template<class dataType >
void preprocessTree (ftm::FTMTree_MT *tree, bool deleteInconsistentNodes=true)
 
template<class dataType >
ftm::FTMTree_MTcomputeBranchDecomposition (ftm::FTMTree_MT *tree, std::vector< std::vector< ftm::idNode > > &treeNodeMerged)
 
template<class dataType >
void dontUseMinMaxPair (ftm::FTMTree_MT *tree)
 
void verifyPairsTree (ftm::FTMTree_MT *tree)
 
template<class dataType >
void deleteMultiPersPairs (ftm::FTMTree_MT *tree, bool useBD)
 
template<class dataType >
void preprocessingPipeline (ftm::MergeTree< dataType > &mTree, double epsilonTree, double epsilon2Tree, double epsilon3Tree, bool branchDecompositionT, bool useMinMaxPairT, bool cleanTreeT, double persistenceThreshold, std::vector< int > &nodeCorr, bool deleteInconsistentNodes=true)
 
template<class dataType >
void preprocessingPipeline (ftm::MergeTree< dataType > &mTree, double epsilonTree, double epsilon2Tree, double epsilon3Tree, bool branchDecompositionT, bool useMinMaxPairT, bool cleanTreeT, std::vector< int > &nodeCorr, bool deleteInconsistentNodes=true)
 
void reverseNodeCorr (ftm::FTMTree_MT *tree, std::vector< int > &nodeCorr)
 
template<class dataType >
void mtFlattening (ftm::MergeTree< dataType > &mt)
 
template<class dataType >
void mtsFlattening (std::vector< ftm::MergeTree< dataType > > &mts)
 
double getSizeLimitMetric (std::vector< ftm::FTMTree_MT * > &trees)
 
template<class dataType >
void copyMinMaxPair (ftm::MergeTree< dataType > &mTree1, ftm::MergeTree< dataType > &mTree2, bool setOrigins=false)
 
template<class dataType >
std::tuple< int, dataType > fixMergedRootOrigin (ftm::FTMTree_MT *tree)
 
template<class dataType >
void branchDecompositionToTree (ftm::FTMTree_MT *tree)
 
template<class dataType >
void putBackMergedNodes (ftm::FTMTree_MT *tree)
 
template<class dataType >
void postprocessingPipeline (ftm::FTMTree_MT *tree)
 
template<class dataType >
void convertBranchDecompositionMatching (ftm::FTMTree_MT *tree1, ftm::FTMTree_MT *tree2, std::vector< std::tuple< ftm::idNode, ftm::idNode, double > > &outputMatching)
 
template<class dataType >
void convertBranchDecompositionMatching (ftm::FTMTree_MT *tree1, ftm::FTMTree_MT *tree2, std::vector< std::tuple< ftm::idNode, ftm::idNode > > &outputMatching)
 
template<class dataType >
void identifyRealMatching (ftm::FTMTree_MT *tree1, ftm::FTMTree_MT *tree2, std::vector< std::tuple< ftm::idNode, ftm::idNode > > &outputMatching, std::vector< std::tuple< ftm::idNode, ftm::idNode, bool > > &realMatching)
 
template<class dataType >
dataType computeDistance (dataType x1, dataType x2, dataType y1, dataType y2, double power=2)
 
template<class dataType >
dataType deleteCost (ftm::FTMTree_MT *tree, ftm::idNode nodeId)
 
template<class dataType >
dataType insertCost (ftm::FTMTree_MT *tree, ftm::idNode nodeId)
 
template<class dataType >
dataType relabelCostOnly (ftm::FTMTree_MT *tree1, ftm::idNode nodeId1, ftm::FTMTree_MT *tree2, ftm::idNode nodeId2)
 
template<class dataType >
dataType relabelCost (ftm::FTMTree_MT *tree1, ftm::idNode nodeId1, ftm::FTMTree_MT *tree2, ftm::idNode nodeId2)
 
void getParamNames (std::vector< std::string > &paramNames)
 
double getParamValueFromName (std::string &paramName)
 
void setParamValueFromName (std::string &paramName, double value)
 
void getTreesStats (std::vector< ftm::FTMTree_MT * > &trees, std::array< double, 3 > &stats)
 
void printTreesStats (std::vector< ftm::FTMTree_MT * > &trees)
 
template<class dataType >
void printTreesStats (std::vector< ftm::MergeTree< dataType > > &trees)
 
template<class dataType >
void printTableVector (std::vector< std::vector< dataType > > &table)
 
template<class dataType >
void printTable (dataType *table, int nRows, int nCols)
 
void printMatching (std::vector< MatchingType > &matchings)
 
void printMatching (std::vector< std::tuple< ftm::idNode, ftm::idNode, double > > &matchings)
 
void printMatching (std::vector< std::tuple< ftm::idNode, ftm::idNode > > &matchings)
 
template<class dataType >
void printPairs (std::vector< std::tuple< SimplexId, SimplexId, dataType > > &treePairs)
 
template<class dataType >
void printOutputMatching (std::vector< std::tuple< ftm::idNode, ftm::idNode > > &outputMatching, ftm::FTMTree_MT *tree1, ftm::FTMTree_MT *tree2, bool computeCosts=true)
 

Protected Attributes

double removalPercentage_ = 50.
 
bool useL2Distance_ = false
 
std::vector< std::vector< double > > fieldL2_
 
bool useCustomTimeVariable_ = false
 
std::vector< double > timeVariable_
 
- 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_
 
- Protected Attributes inherited from ttk::MergeTreeBase
int assignmentSolverID_ = 0
 
bool epsilon1UseFarthestSaddle_ = false
 
double epsilonTree1_ = 0
 
double epsilonTree2_ = 0
 
double epsilon2Tree1_ = 100
 
double epsilon2Tree2_ = 100
 
double epsilon3Tree1_ = 100
 
double epsilon3Tree2_ = 100
 
double persistenceThreshold_ = 0
 
bool barycenterMergeTree_ = false
 
bool useMinMaxPair_ = true
 
bool deleteMultiPersPairs_ = false
 
bool branchDecomposition_ = true
 
int wassersteinPower_ = 2
 
bool normalizedWasserstein_ = true
 
bool keepSubtree_ = false
 
double nonMatchingWeight_ = 1.0
 
bool distanceSquaredRoot_ = true
 
bool useFullMerge_ = false
 
bool isPersistenceDiagram_ = false
 
bool convertToDiagram_ = false
 
double mixtureCoefficient_ = 0.5
 
bool useDoubleInput_ = false
 
bool parallelize_ = true
 
int nodePerTask_ = 32
 
bool cleanTree_ = true
 
std::vector< std::vector< int > > treesNodeCorr_
 

Additional Inherited Members

- 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)
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

The MergeTreeTemporalReduction class provides methods to compute a temporal reduction of a sequence of merge trees.

Author
Mathieu Pont (mathi.nosp@m.eu.p.nosp@m.ont@l.nosp@m.ip6..nosp@m.fr)
Date
2021.

This module defines the MergeTreeTemporalReduction class that computes a temporal reduction of a sequence of merge trees.

Related publication
"Wasserstein Distances, Geodesics and Barycenters of Merge Trees"
Mathieu Pont, Jules Vidal, Julie Delon, Julien Tierny.
Proc. of IEEE VIS 2021.
IEEE Transactions on Visualization and Computer Graphics, 2021

Online examples:

Definition at line 36 of file MergeTreeTemporalReduction.h.

Constructor & Destructor Documentation

◆ MergeTreeTemporalReduction()

ttk::MergeTreeTemporalReduction::MergeTreeTemporalReduction ( )

Definition at line 3 of file MergeTreeTemporalReduction.cpp.

Member Function Documentation

◆ computeAlpha()

double ttk::MergeTreeTemporalReduction::computeAlpha ( int  index1,
int  middleIndex,
int  index2 
)
inline

Definition at line 159 of file MergeTreeTemporalReduction.h.

◆ computeBarycenter()

template<class dataType >
ftm::MergeTree< dataType > ttk::MergeTreeTemporalReduction::computeBarycenter ( ftm::MergeTree< dataType > &  mTree1,
ftm::MergeTree< dataType > &  mTree2,
double  alpha 
)
inline

Definition at line 124 of file MergeTreeTemporalReduction.h.

◆ computeDistance()

template<class dataType >
dataType ttk::MergeTreeTemporalReduction::computeDistance ( ftm::MergeTree< dataType > &  mTree1,
ftm::MergeTree< dataType > &  mTree2,
bool  emptyTreeDistance = false 
)
inline

Definition at line 91 of file MergeTreeTemporalReduction.h.

◆ computeL2Barycenter()

template<class dataType >
std::vector< dataType > ttk::MergeTreeTemporalReduction::computeL2Barycenter ( std::vector< dataType > &  img1,
std::vector< dataType > &  img2,
double  alpha 
)
inline

Definition at line 77 of file MergeTreeTemporalReduction.h.

◆ computeL2Distance()

template<class dataType >
dataType ttk::MergeTreeTemporalReduction::computeL2Distance ( std::vector< dataType > &  img1,
std::vector< dataType > &  img2,
bool  emptyFieldDistance = false 
)
inline

Definition at line 57 of file MergeTreeTemporalReduction.h.

◆ execute()

template<class dataType >
std::vector< int > ttk::MergeTreeTemporalReduction::execute ( std::vector< ftm::MergeTree< dataType > > &  mTrees,
std::vector< double > &  emptyTreeDistances,
std::vector< ftm::MergeTree< dataType > > &  allMT 
)
inline

Definition at line 309 of file MergeTreeTemporalReduction.h.

◆ setRemovalPercentage()

void ttk::MergeTreeTemporalReduction::setRemovalPercentage ( double  rs)
inline

Definition at line 48 of file MergeTreeTemporalReduction.h.

◆ setUseL2Distance()

void ttk::MergeTreeTemporalReduction::setUseL2Distance ( bool  useL2)
inline

Definition at line 52 of file MergeTreeTemporalReduction.h.

◆ temporalSubsampling()

template<class dataType >
void ttk::MergeTreeTemporalReduction::temporalSubsampling ( std::vector< ftm::MergeTree< dataType > > &  mTrees,
std::vector< int > &  removed,
std::vector< ftm::MergeTree< dataType > > &  barycenters,
std::vector< std::vector< dataType > > &  barycentersL2 
)
inline

Definition at line 168 of file MergeTreeTemporalReduction.h.

Member Data Documentation

◆ fieldL2_

std::vector<std::vector<double> > ttk::MergeTreeTemporalReduction::fieldL2_
protected

Definition at line 41 of file MergeTreeTemporalReduction.h.

◆ removalPercentage_

double ttk::MergeTreeTemporalReduction::removalPercentage_ = 50.
protected

Definition at line 39 of file MergeTreeTemporalReduction.h.

◆ timeVariable_

std::vector<double> ttk::MergeTreeTemporalReduction::timeVariable_
protected

Definition at line 43 of file MergeTreeTemporalReduction.h.

◆ useCustomTimeVariable_

bool ttk::MergeTreeTemporalReduction::useCustomTimeVariable_ = false
protected

Definition at line 42 of file MergeTreeTemporalReduction.h.

◆ useL2Distance_

bool ttk::MergeTreeTemporalReduction::useL2Distance_ = false
protected

Definition at line 40 of file MergeTreeTemporalReduction.h.


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