TTK
Loading...
Searching...
No Matches
ttkMergeTreeDistanceMatrix.h
Go to the documentation of this file.
1
61
62#pragma once
63
64// VTK Module
65#include <ttkMergeTreeDistanceMatrixModule.h>
66
67// VTK Includes
68#include <ttkAlgorithm.h>
69#include <vtkMultiBlockDataSet.h>
70#include <vtkSmartPointer.h>
71#include <vtkUnstructuredGrid.h>
72
73// TTK Base Includes
75
76class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix
77 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
78 ,
79 protected ttk::MergeTreeDistanceMatrix // and we inherit from the base class
80{
81private:
86 // Execution Options
87 int Backend = 0;
88 bool oldBD = branchDecomposition_;
89 bool oldNW = normalizedWasserstein_;
90 bool oldKS = keepSubtree_;
91
92 bool UseFieldDataParameters = false;
93 int DiagramPairTypes = 0;
94
95public:
100 // Input Options
101 void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) {
102 epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle;
103 Modified();
104 }
108
109 void SetEpsilonTree1(double epsilonTree1) {
110 epsilonTree1_ = epsilonTree1;
111 Modified();
112 }
114 return epsilonTree1_;
115 }
116
117 void SetEpsilon2Tree1(double epsilon2Tree1) {
118 epsilon2Tree1_ = epsilon2Tree1;
119 Modified();
120 }
122 return epsilon2Tree1_;
123 }
124
125 void SetEpsilon3Tree1(double epsilon3Tree1) {
126 epsilon3Tree1_ = epsilon3Tree1;
127 Modified();
128 }
130 return epsilon3Tree1_;
131 }
132
133 void SetPersistenceThreshold(double persistenceThreshold) {
134 persistenceThreshold_ = persistenceThreshold;
135 Modified();
136 }
139 }
140
141 void SetDeleteMultiPersPairs(bool doDelete) {
142 deleteMultiPersPairs_ = doDelete;
143 Modified();
144 }
148
149 void SetBranchMetric(int m) {
150 branchMetric_ = m;
151 Modified();
152 }
153
154 void SetPathMetric(int m) {
155 pathMetric_ = m;
156 Modified();
157 }
158
159 // Execution Options
160 void SetBackend(int newBackend) {
161 if(Backend == 2) { // Custom
162 oldBD = branchDecomposition_;
164 oldKS = keepSubtree_;
165 }
166 if(newBackend == 2) { // Custom
167 branchDecomposition_ = oldBD;
169 keepSubtree_ = oldKS;
170 }
171 Backend = newBackend;
172 Modified();
173 }
174 vtkGetMacro(Backend, int);
175
176 void SetAssignmentSolver(int assignmentSolver) {
177 assignmentSolverID_ = assignmentSolver;
178 Modified();
179 }
181 return assignmentSolverID_;
182 }
183
184 void SetBranchDecomposition(bool branchDecomposition) {
185 branchDecomposition_ = branchDecomposition;
186 Modified();
187 }
191
192 void SetNormalizedWasserstein(bool normalizedWasserstein) {
193 normalizedWasserstein_ = normalizedWasserstein;
194 Modified();
195 }
199
200 void SetKeepSubtree(bool keepSubtree) {
201 keepSubtree_ = keepSubtree;
202 Modified();
203 }
205 return keepSubtree_;
206 }
207
208 void SetDistanceSquaredRoot(bool distanceSquaredRoot) {
209 distanceSquaredRoot_ = distanceSquaredRoot;
210 Modified();
211 }
215
216 vtkSetMacro(UseFieldDataParameters, bool);
217 vtkGetMacro(UseFieldDataParameters, bool);
218
219 vtkSetMacro(mixtureCoefficient_, double);
220 vtkGetMacro(mixtureCoefficient_, double);
221
222 vtkSetMacro(DiagramPairTypes, int);
223 vtkGetMacro(DiagramPairTypes, int);
224
231
232protected:
239
244 int FillInputPortInformation(int port, vtkInformation *info) override;
245
250 int FillOutputPortInformation(int port, vtkInformation *info) override;
251
256 int RequestData(vtkInformation *request,
257 vtkInformationVector **inputVector,
258 vtkInformationVector *outputVector) override;
259
260 template <class dataType>
261 int run(vtkInformationVector *outputVector,
262 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
263 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
264};
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)