From d255f336fef6239a88f86ad8cfed59315d004aec Mon Sep 17 00:00:00 2001 From: MatPont Date: Mon, 16 Sep 2024 18:00:00 +0200 Subject: [PATCH] [MergeTree] saddle-saddle pairs processing --- core/vtk/ttkMergeTree/ttkMergeTreeUtils.h | 62 +++++++++++++++---- .../ttkMergeTreeAutoencoder.cpp | 11 +++- .../ttkMergeTreeAutoencoder.h | 8 +++ .../ttkMergeTreeAutoencoderDecoding.cpp | 14 +++-- .../ttkMergeTreeAutoencoderDecoding.h | 3 + .../ttkMergeTreeClustering.cpp | 11 ++-- .../ttkMergeTreeClustering.h | 8 +++ .../ttkMergeTreeDistanceMatrix.cpp | 10 +-- .../ttkMergeTreeDistanceMatrix.h | 4 ++ .../ttkMergeTreePrincipalGeodesics.cpp | 14 +++-- .../ttkMergeTreePrincipalGeodesics.h | 8 +++ ...ttkMergeTreePrincipalGeodesicsDecoding.cpp | 15 +++-- .../ttkMergeTreePrincipalGeodesicsDecoding.h | 2 + paraview/xmls/MergeTreeAutoencoder.xml | 20 +++++- paraview/xmls/MergeTreeClustering.xml | 20 +++++- paraview/xmls/MergeTreeDistanceMatrix.xml | 22 ++++++- paraview/xmls/MergeTreePrincipalGeodesics.xml | 20 +++++- 17 files changed, 208 insertions(+), 44 deletions(-) diff --git a/core/vtk/ttkMergeTree/ttkMergeTreeUtils.h b/core/vtk/ttkMergeTree/ttkMergeTreeUtils.h index 40f08e31be..6b1f95577e 100644 --- a/core/vtk/ttkMergeTree/ttkMergeTreeUtils.h +++ b/core/vtk/ttkMergeTree/ttkMergeTreeUtils.h @@ -87,11 +87,29 @@ namespace ttk { return mergeTree; } - // Returns a branch decomposition tree + /** + * @brief Create a MergeTree (as a branch decomposition tree) object given a + * vtkUnstructuredGrid representing a persistence diagram (in the TTK + * format). + * + * @param[in] persistenceDiagram vtk object representing the persistence + * diagram. + * @param[in] useSecondPairsType boolean to choose which pair type to use + * depending on the value of diagramPairTypes, by default the choice is + * between min-saddle and saddle-max, true for the second type and false for + * the first type. + * @param[in] diagramPairTypes 0 to choose between min-saddle and + * saddle-max, 1 to choose between min-saddle and saddle-saddle, 2 to choose + * between saddle-saddle and saddle-max. + * + * @return a MergeTree object corresponding to the input persistence + * diagram. + */ template MergeTree makeBDTreeFromPDGrid(vtkUnstructuredGrid *persistenceDiagram, - bool useSadMaxPairs = true) { + bool useSecondPairsType = true, + int diagramPairTypes = 0) { auto birthArray = persistenceDiagram->GetCellData()->GetArray(PersistenceBirthName); auto persArray @@ -126,6 +144,18 @@ namespace ttk { // Init critical type enum values auto locMin = static_cast(CriticalType::Local_minimum); auto locMax = static_cast(CriticalType::Local_maximum); + auto locSad1 = static_cast(CriticalType::Saddle1); + auto locSad2 = static_cast(CriticalType::Saddle2); + + // 0 : min-saddle ; 1 : saddle-saddle : 2 : saddle-max + int pairsType + = (useSecondPairsType + and (diagramPairTypes == 0 or diagramPairTypes == 2) + ? 2 + : (not useSecondPairsType + and (diagramPairTypes == 0 or diagramPairTypes == 1) + ? 0 + : 1)); // Get Min-Max pair index int minMaxPairIndex = -1; @@ -151,8 +181,11 @@ namespace ttk { auto ct1 = criticalTypeArray->GetTuple1(pts[0]); auto ct2 = criticalTypeArray->GetTuple1(pts[1]); if((pairType == -1 - or (useSadMaxPairs and ct1 != locMax and ct2 != locMax) - or (not useSadMaxPairs and ct1 != locMin and ct2 != locMin)) + or (pairsType == 2 and ct1 != locMax and ct2 != locMax) + or (pairsType == 1 + and not((ct1 == locSad1 and ct2 == locSad2) + or (ct1 == locSad2 and ct2 == locSad1))) + or (pairsType == 0 and ct1 != locMin and ct2 != locMin)) and i != minMaxPairIndex) continue; int const index1 @@ -218,7 +251,8 @@ namespace ttk { std::vector &treesNodes, std::vector &treesArcs, std::vector &treesSegmentation, - std::vector useSadMaxPairs) { + const std::vector &useSecondPairsTypeVec, + int diagramPairTypes = 0) { bool isPersistenceDiagram = false; const int numInputs = inputTrees.size(); intermediateTrees.resize(numInputs); @@ -242,7 +276,7 @@ namespace ttk { vtkUnstructuredGrid *persistenceDiagram = vtkUnstructuredGrid::SafeDownCast(inputTrees[i]->GetBlock(0)); intermediateTrees[i] = makeBDTreeFromPDGrid( - persistenceDiagram, useSadMaxPairs[i]); + persistenceDiagram, useSecondPairsTypeVec[i], diagramPairTypes); isPersistenceDiagram = true; } } @@ -256,23 +290,27 @@ namespace ttk { std::vector &treesNodes, std::vector &treesArcs, std::vector &treesSegmentation, - bool useSadMaxPairs = true) { - std::vector const useSadMaxPairsVec( - inputTrees.size(), useSadMaxPairs); + bool useSecondPairsType = true, + int diagramPairTypes = 0) { + const std::vector useSecondPairsTypeVec( + inputTrees.size(), useSecondPairsType); return constructTrees(inputTrees, intermediateTrees, treesNodes, - treesArcs, treesSegmentation, useSadMaxPairsVec); + treesArcs, treesSegmentation, useSecondPairsTypeVec, + diagramPairTypes); } template bool constructTrees( std::vector> &inputTrees, std::vector> &intermediateTrees, - bool useSadMaxPairs = true) { + bool useSecondPairsType = true, + int diagramPairTypes = 0) { std::vector treesNodes; std::vector treesArcs; std::vector treesSegmentation; return constructTrees(inputTrees, intermediateTrees, treesNodes, - treesArcs, treesSegmentation, useSadMaxPairs); + treesArcs, treesSegmentation, useSecondPairsType, + diagramPairTypes); } } // namespace ftm } // namespace ttk diff --git a/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.cpp b/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.cpp index 09676e0f38..bbe308b85b 100644 --- a/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.cpp +++ b/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.cpp @@ -187,10 +187,10 @@ int ttkMergeTreeAutoencoder::runCompute( std::vector> intermediateMTrees, intermediateMTrees2; - bool useSadMaxPairs = (mixtureCoefficient_ == 0); + bool useSecondPairsType = (mixtureCoefficient_ == 0); isPersistenceDiagram_ = ttk::ftm::constructTrees( inputTrees, intermediateMTrees, treesNodes, treesArcs, treesSegmentation, - useSadMaxPairs); + useSecondPairsType, DiagramPairTypes); // If merge trees are provided in input and normalization is not asked convertToDiagram_ = (not isPersistenceDiagram_ and not normalizedWasserstein_); @@ -200,7 +200,7 @@ int ttkMergeTreeAutoencoder::runCompute( = (not isPersistenceDiagram_ ? inputTrees2 : inputTrees); ttk::ftm::constructTrees(inputTrees2ToUse, intermediateMTrees2, treesNodes2, treesArcs2, treesSegmentation2, - !useSadMaxPairs); + !useSecondPairsType, DiagramPairTypes); } isPersistenceDiagram_ |= (not normalizedWasserstein_); @@ -529,6 +529,11 @@ int ttkMergeTreeAutoencoder::runOutput( arrayActivateFunction->InsertNextTuple1(activationFunction_); output_coef->GetFieldData()->AddArray(arrayActivateFunction); + vtkNew diagramPairTypesArray{}; + diagramPairTypesArray->SetName("DiagramPairTypes"); + diagramPairTypesArray->InsertNextTuple1(DiagramPairTypes); + output_coef->GetFieldData()->AddArray(diagramPairTypesArray); + // ------------------------------------------ // --- Axes Vectors // ------------------------------------------ diff --git a/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.h b/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.h index 656e643c18..d535e8683f 100644 --- a/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.h +++ b/core/vtk/ttkMergeTreeAutoencoder/ttkMergeTreeAutoencoder.h @@ -68,6 +68,7 @@ class TTKMERGETREEAUTOENCODER_EXPORT ttkMergeTreeAutoencoder */ // Input options double oldEpsilonTree1; + int DiagramPairTypes = 0; // ---------------------- // Data for visualization @@ -442,6 +443,13 @@ class TTKMERGETREEAUTOENCODER_EXPORT ttkMergeTreeAutoencoder return mixtureCoefficient_; } + void SetDiagramPairTypes(int diagramPairTypes) { + DiagramPairTypes = diagramPairTypes; + Modified(); + resetDataVisualization(); + } + vtkGetMacro(DiagramPairTypes, int); + void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) { epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle; Modified(); diff --git a/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.cpp b/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.cpp index e6f439c734..8aec9b976d 100644 --- a/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.cpp +++ b/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.cpp @@ -141,6 +141,10 @@ int ttkMergeTreeAutoencoderDecoding::RequestData( else printMsg("Computation without normalized Wasserstein."); + auto diagramPairTypesArray = fd->GetArray("DiagramPairTypes"); + if(diagramPairTypesArray) + DiagramPairTypes = diagramPairTypesArray->GetTuple1(0); + // ----------------- // Origins // ----------------- @@ -156,13 +160,13 @@ int ttkMergeTreeAutoencoderDecoding::RequestData( std::vector originsTreeSegmentations, originsPrimeTreeSegmentations; - bool useSadMaxPairs = (mixtureCoefficient_ == 0); + bool useSecondPairsType = (mixtureCoefficient_ == 0); isPersistenceDiagram_ = ttk::ftm::constructTrees( origins, originsTrees, originsTreeNodes, originsTreeArcs, - originsTreeSegmentations, useSadMaxPairs); - ttk::ftm::constructTrees(originsPrime, originsPrimeTrees, - originsTreeNodes, originsTreeArcs, - originsTreeSegmentations, useSadMaxPairs); + originsTreeSegmentations, useSecondPairsType, DiagramPairTypes); + ttk::ftm::constructTrees( + originsPrime, originsPrimeTrees, originsTreeNodes, originsTreeArcs, + originsTreeSegmentations, useSecondPairsType, DiagramPairTypes); // If merge trees are provided in input and normalization is not asked convertToDiagram_ = (not isPersistenceDiagram_ and not normalizedWasserstein_); diff --git a/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.h b/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.h index fd40aab8c2..6e980cbb4c 100644 --- a/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.h +++ b/core/vtk/ttkMergeTreeAutoencoderDecoding/ttkMergeTreeAutoencoderDecoding.h @@ -59,6 +59,9 @@ class TTKMERGETREEAUTOENCODERDECODING_EXPORT ttkMergeTreeAutoencoderDecoding * Add all filter parameters only as private member variables and * initialize them here. */ +#ifdef TTK_ENABLE_TORCH + int DiagramPairTypes = 0; +#endif public: /** diff --git a/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.cpp b/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.cpp index 4453dee26e..4ea01a589c 100644 --- a/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.cpp +++ b/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.cpp @@ -185,17 +185,18 @@ int ttkMergeTreeClustering::runCompute( std::vector intermediateTrees(numInputs), intermediateTrees2(numInputs2); - bool const useSadMaxPairs = (JoinSplitMixtureCoefficient == 0); - IsPersistenceDiagram - = constructTrees(inputTrees, intermediateMTrees, treesNodes, - treesArcs, treesSegmentation, useSadMaxPairs); + bool const useSecondPairsType = (JoinSplitMixtureCoefficient == 0); + IsPersistenceDiagram = constructTrees( + inputTrees, intermediateMTrees, treesNodes, treesArcs, treesSegmentation, + useSecondPairsType, DiagramPairTypes); if(not IsPersistenceDiagram or (JoinSplitMixtureCoefficient != 0 and JoinSplitMixtureCoefficient != 1)) { auto &inputTrees2ToUse = (not IsPersistenceDiagram ? inputTrees2 : inputTrees); constructTrees(inputTrees2ToUse, intermediateMTrees2, treesNodes2, - treesArcs2, treesSegmentation2, !useSadMaxPairs); + treesArcs2, treesSegmentation2, + !useSecondPairsType, DiagramPairTypes); } mergeTreeToFTMTree(intermediateMTrees, intermediateTrees); diff --git a/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.h b/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.h index 83cfe315d2..bf76e2601b 100644 --- a/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.h +++ b/core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.h @@ -92,6 +92,7 @@ class TTKMERGETREECLUSTERING_EXPORT ttkMergeTreeClustering bool oldNW = NormalizedWasserstein; bool oldKS = KeepSubtree; double JoinSplitMixtureCoefficient = 0.5; + int DiagramPairTypes = 0; bool ComputeBarycenter = false; unsigned int NumberOfBarycenters = 1; double BarycenterSizeLimitPercent = 0.0; @@ -314,6 +315,13 @@ class TTKMERGETREECLUSTERING_EXPORT ttkMergeTreeClustering } vtkGetMacro(JoinSplitMixtureCoefficient, double); + void SetDiagramPairTypes(int diagramPairTypes) { + DiagramPairTypes = diagramPairTypes; + Modified(); + resetDataVisualization(); + } + vtkGetMacro(DiagramPairTypes, int); + void SetComputeBarycenter(bool computeBarycenter) { ComputeBarycenter = computeBarycenter; Modified(); diff --git a/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.cpp b/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.cpp index 0411b3480b..ba9998bc7a 100644 --- a/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.cpp +++ b/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.cpp @@ -102,14 +102,16 @@ int ttkMergeTreeDistanceMatrix::run( // Construct trees const int numInputs = inputTrees.size(); std::vector> intermediateTrees, intermediateTrees2; - bool const useSadMaxPairs = (mixtureCoefficient_ == 0); // only for PD support - isPersistenceDiagram_ - = constructTrees(inputTrees, intermediateTrees, useSadMaxPairs); + bool const useSecondPairsType + = (mixtureCoefficient_ == 0); // only for PD support + isPersistenceDiagram_ = constructTrees( + inputTrees, intermediateTrees, useSecondPairsType, DiagramPairTypes); if(not isPersistenceDiagram_ or (mixtureCoefficient_ != 0 and mixtureCoefficient_ != 1)) { auto &inputTrees2ToUse = (not isPersistenceDiagram_ ? inputTrees2 : inputTrees); - constructTrees(inputTrees2ToUse, intermediateTrees2, !useSadMaxPairs); + constructTrees(inputTrees2ToUse, intermediateTrees2, !useSecondPairsType, + DiagramPairTypes); } // Verify parameters diff --git a/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.h b/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.h index 8ca345162c..d25277dc17 100644 --- a/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.h +++ b/core/vtk/ttkMergeTreeDistanceMatrix/ttkMergeTreeDistanceMatrix.h @@ -62,6 +62,7 @@ class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix bool oldKS = keepSubtree_; bool UseFieldDataParameters = false; + int DiagramPairTypes = 0; public: /** @@ -190,6 +191,9 @@ class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix vtkSetMacro(mixtureCoefficient_, double); vtkGetMacro(mixtureCoefficient_, double); + vtkSetMacro(DiagramPairTypes, int); + vtkGetMacro(DiagramPairTypes, int); + /** * This static method and the macro below are VTK conventions on how to * instantiate VTK objects. You don't have to modify this. diff --git a/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.cpp b/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.cpp index e1df8308ef..3108990182 100644 --- a/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.cpp +++ b/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.cpp @@ -154,10 +154,10 @@ int ttkMergeTreePrincipalGeodesics::runCompute( std::vector> intermediateMTrees, intermediateMTrees2; - bool const useSadMaxPairs = (mixtureCoefficient_ == 0); + bool const useSecondPairsType = (mixtureCoefficient_ == 0); isPersistenceDiagram_ = ttk::ftm::constructTrees( inputTrees, intermediateMTrees, treesNodes, treesArcs, treesSegmentation, - useSadMaxPairs); + useSecondPairsType, DiagramPairTypes); // If merge trees are provided in input and normalization is not asked convertToDiagram_ = (not isPersistenceDiagram_ and not normalizedWasserstein_); @@ -169,9 +169,9 @@ int ttkMergeTreePrincipalGeodesics::runCompute( or (mixtureCoefficient_ != 0 and mixtureCoefficient_ != 1)) { auto &inputTrees2ToUse = (not isPersistenceDiagram_ ? inputTrees2 : inputTrees); - ttk::ftm::constructTrees(inputTrees2ToUse, intermediateMTrees2, - treesNodes2, treesArcs2, - treesSegmentation2, !useSadMaxPairs); + ttk::ftm::constructTrees( + inputTrees2ToUse, intermediateMTrees2, treesNodes2, treesArcs2, + treesSegmentation2, !useSecondPairsType, DiagramPairTypes); } isPersistenceDiagram_ |= (not normalizedWasserstein_); @@ -329,6 +329,10 @@ int ttkMergeTreePrincipalGeodesics::runOutput( array->InsertNextTuple1(getParamValueFromName(paramName)); output_coef->GetFieldData()->AddArray(array); } + vtkNew diagramPairTypesArray{}; + diagramPairTypesArray->SetName("DiagramPairTypes"); + diagramPairTypesArray->InsertNextTuple1(DiagramPairTypes); + output_coef->GetFieldData()->AddArray(diagramPairTypesArray); // ------------------------------------------ // --- Geodesics Vectors diff --git a/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.h b/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.h index 6f1887191c..2890eee17b 100644 --- a/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.h +++ b/core/vtk/ttkMergeTreePrincipalGeodesics/ttkMergeTreePrincipalGeodesics.h @@ -71,6 +71,7 @@ class TTKMERGETREEPRINCIPALGEODESICS_EXPORT ttkMergeTreePrincipalGeodesics */ // Input options double oldEpsilonTree1; + int DiagramPairTypes = 0; // Output options // ---------------------- @@ -169,6 +170,13 @@ class TTKMERGETREEPRINCIPALGEODESICS_EXPORT ttkMergeTreePrincipalGeodesics return mixtureCoefficient_; } + void SetDiagramPairTypes(int diagramPairTypes) { + DiagramPairTypes = diagramPairTypes; + Modified(); + resetDataVisualization(); + } + vtkGetMacro(DiagramPairTypes, int); + void SetKeepState(bool keepState) { keepState_ = keepState; Modified(); diff --git a/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.cpp b/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.cpp index 265b9bb420..83791cc80d 100644 --- a/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.cpp +++ b/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.cpp @@ -154,6 +154,11 @@ int ttkMergeTreePrincipalGeodesicsDecoding::RequestData( else printMsg("Computation without normalized Wasserstein."); + auto diagramPairTypesArray + = tableCoefficients->GetFieldData()->GetArray("DiagramPairTypes"); + if(diagramPairTypesArray) + DiagramPairTypes = diagramPairTypesArray->GetTuple1(0); + // ------------------------------------------------------------------------------------ // --- Load tables // ------------------------------------------------------------------------------------ @@ -316,21 +321,21 @@ int ttkMergeTreePrincipalGeodesicsDecoding::runCompute( std::vector> baryDTree, inputDTrees; - std::vector useSadMaxPairsVec{false, true}; + std::vector useSecondPairsTypeVec{false, true}; if(not useDoubleInput_ and mixtureCoefficient_ == 0) - useSadMaxPairsVec.erase(useSadMaxPairsVec.begin()); // {true} + useSecondPairsTypeVec.erase(useSecondPairsTypeVec.begin()); // {true} ttk::ftm::constructTrees(inputBary, baryDTree, baryTreeNodes, baryTreeArcs, baryTreeSegmentation, - useSadMaxPairsVec); + useSecondPairsTypeVec, DiagramPairTypes); if(OutputInputTrees or (ReconstructInputTrees and (computeReconstructionError_ or transferInputTreesInformation_))) { - bool const useSadMaxPairs + bool const useSecondPairsType = (useDoubleInput_ and not processFirstInput) or mixtureCoefficient_ == 0; bool const isInputPD = ttk::ftm::constructTrees( inputTrees, inputDTrees, inputTreesNodes, inputTreesArcs, - inputTreesSegmentation, useSadMaxPairs); + inputTreesSegmentation, useSecondPairsType, DiagramPairTypes); if(not isInputPD and isPersistenceDiagram_) mtsFlattening(inputDTrees); } diff --git a/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.h b/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.h index e123fb2c73..ac0995c3e5 100644 --- a/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.h +++ b/core/vtk/ttkMergeTreePrincipalGeodesicsDecoding/ttkMergeTreePrincipalGeodesicsDecoding.h @@ -76,6 +76,8 @@ class TTKMERGETREEPRINCIPALGEODESICSDECODING_EXPORT bool ConstructSurface = false; bool ProcessSecondInput = false; + int DiagramPairTypes = 0; + // ---------------------- // Data for visualization // ---------------------- diff --git a/paraview/xmls/MergeTreeAutoencoder.xml b/paraview/xmls/MergeTreeAutoencoder.xml index a9deb0caf5..636e6db449 100644 --- a/paraview/xmls/MergeTreeAutoencoder.xml +++ b/paraview/xmls/MergeTreeAutoencoder.xml @@ -553,6 +553,23 @@ Online examples: + + + + + + + + The types of pairs to use when the input are persistence diagrams. This can be weigthed with the "Pair Type Mixture Coefficient" parameter (0 for only the second type of pairs and 1 for the first type of pairs). + + + If input are merge trees, this parameter allows to weight between the first input and the second input, typically join and split trees (0 for only the second input and 1 for only the first one). - If input are persistence diagrams, this parameter allows to weight between min-sad and sad-max pairs (0 for only sad-max and 1 for only min-sad). + If input are persistence diagrams, this parameter allows to weight between different types of pairs, determined by the "Diagram Pair Types" parameter (default is min-sad and sad-max pairs), 0 for only the second type and 1 for only the first type. @@ -598,6 +615,7 @@ Online examples: + ${MERGE_TREE_PREPROCESS_WIDGETS} diff --git a/paraview/xmls/MergeTreeClustering.xml b/paraview/xmls/MergeTreeClustering.xml index 2f5133a146..91a5b7295b 100644 --- a/paraview/xmls/MergeTreeClustering.xml +++ b/paraview/xmls/MergeTreeClustering.xml @@ -295,6 +295,23 @@ Online examples: + + + + + + + + The types of pairs to use when the input are persistence diagrams. This can be weigthed with the "Pair Type Mixture Coefficient" parameter (0 for only the second type of pairs and 1 for the first type of pairs). + + + If input are merge trees, this parameter allows to weight between the first input and the second input (only for clustering), typically join and split trees (0 for only the second input and 1 for only the first one). - If input are persistence diagrams, this parameter allows to weight between min-sad and sad-max pairs (0 for only sad-max and 1 for only min-sad). + If input are persistence diagrams, this parameter allows to weight between different types of pairs, determined by the "Diagram Pair Types" parameter (default is min-sad and sad-max pairs), 0 for only the second type and 1 for only the first type. @@ -482,6 +499,7 @@ Online examples: + diff --git a/paraview/xmls/MergeTreeDistanceMatrix.xml b/paraview/xmls/MergeTreeDistanceMatrix.xml index 829764f08c..65002b66cc 100644 --- a/paraview/xmls/MergeTreeDistanceMatrix.xml +++ b/paraview/xmls/MergeTreeDistanceMatrix.xml @@ -70,16 +70,33 @@ Online examples: + + + + + + + + The types of pairs to use when the input are persistence diagrams. This can be weigthed with the "Pair Type Mixture Coefficient" parameter (0 for only the second type of pairs and 1 for the first type of pairs). + + + If input are merge trees, this parameter allows to weight between the first input and the second input, typically join and split trees (0 for only the second input and 1 for only the first one). - If input are persistence diagrams, this parameter allows to weight between min-sad and sad-max pairs (0 for only sad-max and 1 for only min-sad). + If input are persistence diagrams, this parameter allows to weight between different types of pairs, determined by the "Diagram Pair Types" parameter (default is min-sad and sad-max pairs), 0 for only the second type and 1 for only the first type. @@ -100,6 +117,7 @@ Online examples: + diff --git a/paraview/xmls/MergeTreePrincipalGeodesics.xml b/paraview/xmls/MergeTreePrincipalGeodesics.xml index 3360ec8c20..e05cb1958e 100644 --- a/paraview/xmls/MergeTreePrincipalGeodesics.xml +++ b/paraview/xmls/MergeTreePrincipalGeodesics.xml @@ -136,6 +136,23 @@ + + + + + + + + The types of pairs to use when the input are persistence diagrams. This can be weigthed with the "Pair Type Mixture Coefficient" parameter (0 for only the second type of pairs and 1 for the first type of pairs). + + + If input are merge trees, this parameter allows to weight between the first input and the second input, typically join and split trees (0 for only the second input and 1 for only the first one). - If input are persistence diagrams, this parameter allows to weight between min-sad and sad-max pairs (0 for only sad-max and 1 for only min-sad). + If input are persistence diagrams, this parameter allows to weight between different types of pairs, determined by the "Diagram Pair Types" parameter (default is min-sad and sad-max pairs), 0 for only the second type and 1 for only the first type. @@ -172,6 +189,7 @@ + ${MERGE_TREE_PREPROCESS_WIDGETS}