TTK
Loading...
Searching...
No Matches
ttkMergeTreeDistanceMatrix.h
Go to the documentation of this file.
1
33
34#pragma once
35
36// VTK Module
37#include <ttkMergeTreeDistanceMatrixModule.h>
38
39// VTK Includes
40#include <ttkAlgorithm.h>
41#include <vtkMultiBlockDataSet.h>
42#include <vtkSmartPointer.h>
43#include <vtkUnstructuredGrid.h>
44
45// TTK Base Includes
47
48class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix
49 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
50 ,
51 protected ttk::MergeTreeDistanceMatrix // and we inherit from the base class
52{
53private:
58 // Execution Options
59 int Backend = 0;
60 bool oldBD = branchDecomposition_;
61 bool oldNW = normalizedWasserstein_;
62 bool oldKS = keepSubtree_;
63
64 bool UseFieldDataParameters = false;
65 int DiagramPairTypes = 0;
66
67public:
72 // Input Options
73 void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) {
74 epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle;
75 Modified();
76 }
80
81 void SetEpsilonTree1(double epsilonTree1) {
82 epsilonTree1_ = epsilonTree1;
83 Modified();
84 }
85 double SetEpsilonTree1() {
86 return epsilonTree1_;
87 }
88
89 void SetEpsilon2Tree1(double epsilon2Tree1) {
90 epsilon2Tree1_ = epsilon2Tree1;
91 Modified();
92 }
94 return epsilon2Tree1_;
95 }
96
97 void SetEpsilon3Tree1(double epsilon3Tree1) {
98 epsilon3Tree1_ = epsilon3Tree1;
99 Modified();
100 }
102 return epsilon3Tree1_;
103 }
104
105 void SetPersistenceThreshold(double persistenceThreshold) {
106 persistenceThreshold_ = persistenceThreshold;
107 Modified();
108 }
111 }
112
113 void SetDeleteMultiPersPairs(bool doDelete) {
114 deleteMultiPersPairs_ = doDelete;
115 Modified();
116 }
120
121 void SetBranchMetric(int m) {
122 branchMetric_ = m;
123 Modified();
124 }
125
126 void SetPathMetric(int m) {
127 pathMetric_ = m;
128 Modified();
129 }
130
131 // Execution Options
132 void SetBackend(int newBackend) {
133 if(Backend == 2) { // Custom
134 oldBD = branchDecomposition_;
136 oldKS = keepSubtree_;
137 }
138 if(newBackend == 2) { // Custom
139 branchDecomposition_ = oldBD;
141 keepSubtree_ = oldKS;
142 }
143 Backend = newBackend;
144 Modified();
145 }
146 vtkGetMacro(Backend, int);
147
148 void SetAssignmentSolver(int assignmentSolver) {
149 assignmentSolverID_ = assignmentSolver;
150 Modified();
151 }
153 return assignmentSolverID_;
154 }
155
156 void SetBranchDecomposition(bool branchDecomposition) {
157 branchDecomposition_ = branchDecomposition;
158 Modified();
159 }
163
164 void SetNormalizedWasserstein(bool normalizedWasserstein) {
165 normalizedWasserstein_ = normalizedWasserstein;
166 Modified();
167 }
171
172 void SetKeepSubtree(bool keepSubtree) {
173 keepSubtree_ = keepSubtree;
174 Modified();
175 }
177 return keepSubtree_;
178 }
179
180 void SetDistanceSquaredRoot(bool distanceSquaredRoot) {
181 distanceSquaredRoot_ = distanceSquaredRoot;
182 Modified();
183 }
187
188 vtkSetMacro(UseFieldDataParameters, bool);
189 vtkGetMacro(UseFieldDataParameters, bool);
190
191 vtkSetMacro(mixtureCoefficient_, double);
192 vtkGetMacro(mixtureCoefficient_, double);
193
194 vtkSetMacro(DiagramPairTypes, int);
195 vtkGetMacro(DiagramPairTypes, int);
196
203
204protected:
211
216 int FillInputPortInformation(int port, vtkInformation *info) override;
217
222 int FillOutputPortInformation(int port, vtkInformation *info) override;
223
228 int RequestData(vtkInformation *request,
229 vtkInformationVector **inputVector,
230 vtkInformationVector *outputVector) override;
231
232 template <class dataType>
233 int run(vtkInformationVector *outputVector,
234 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
235 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
236};
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int FillInputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
void SetEpsilon2Tree1(double epsilon2Tree1)
void SetNormalizedWasserstein(bool normalizedWasserstein)
~ttkMergeTreeDistanceMatrix() override
void SetPersistenceThreshold(double persistenceThreshold)
void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle)
void SetAssignmentSolver(int assignmentSolver)
void SetBranchDecomposition(bool branchDecomposition)
void SetEpsilonTree1(double epsilonTree1)
void SetEpsilon3Tree1(double epsilon3Tree1)
static ttkMergeTreeDistanceMatrix * New()
int run(vtkInformationVector *outputVector, std::vector< vtkSmartPointer< vtkMultiBlockDataSet > > &inputTrees, std::vector< vtkSmartPointer< vtkMultiBlockDataSet > > &inputTrees2)
void SetDistanceSquaredRoot(bool distanceSquaredRoot)