TTK
Loading...
Searching...
No Matches
ttkMergeTreeDistanceMatrix.h
Go to the documentation of this file.
1
30
31#pragma once
32
33// VTK Module
34#include <ttkMergeTreeDistanceMatrixModule.h>
35
36// VTK Includes
37#include <ttkAlgorithm.h>
38#include <vtkMultiBlockDataSet.h>
39#include <vtkSmartPointer.h>
40#include <vtkUnstructuredGrid.h>
41
42// TTK Base Includes
44
45class TTKMERGETREEDISTANCEMATRIX_EXPORT ttkMergeTreeDistanceMatrix
46 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
47 ,
48 protected ttk::MergeTreeDistanceMatrix // and we inherit from the base class
49{
50private:
55 // Execution Options
56 int Backend = 0;
57 bool oldBD = branchDecomposition_;
58 bool oldNW = normalizedWasserstein_;
59 bool oldKS = keepSubtree_;
60
61 bool UseFieldDataParameters = false;
62
63public:
68 // Input Options
69 void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) {
70 epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle;
71 Modified();
72 }
75 }
76
77 void SetEpsilonTree1(double epsilonTree1) {
78 epsilonTree1_ = epsilonTree1;
79 Modified();
80 }
81 double SetEpsilonTree1() {
82 return epsilonTree1_;
83 }
84
85 void SetEpsilon2Tree1(double epsilon2Tree1) {
86 epsilon2Tree1_ = epsilon2Tree1;
87 Modified();
88 }
90 return epsilon2Tree1_;
91 }
92
93 void SetEpsilon3Tree1(double epsilon3Tree1) {
94 epsilon3Tree1_ = epsilon3Tree1;
95 Modified();
96 }
98 return epsilon3Tree1_;
99 }
100
101 void SetPersistenceThreshold(double persistenceThreshold) {
102 persistenceThreshold_ = persistenceThreshold;
103 Modified();
104 }
107 }
108
109 void SetDeleteMultiPersPairs(bool doDelete) {
110 deleteMultiPersPairs_ = doDelete;
111 Modified();
112 }
115 }
116
117 void SetBranchMetric(int m) {
118 branchMetric_ = m;
119 Modified();
120 }
121
122 void SetPathMetric(int m) {
123 pathMetric_ = m;
124 Modified();
125 }
126
127 // Execution Options
128 void SetBackend(int newBackend) {
129 if(Backend == 2) { // Custom
130 oldBD = branchDecomposition_;
132 oldKS = keepSubtree_;
133 }
134 if(newBackend == 2) { // Custom
135 branchDecomposition_ = oldBD;
136 normalizedWasserstein_ = oldNW;
137 keepSubtree_ = oldKS;
138 }
139 Backend = newBackend;
140 Modified();
141 }
142 vtkGetMacro(Backend, int);
143
144 void SetAssignmentSolver(int assignmentSolver) {
145 assignmentSolverID_ = assignmentSolver;
146 Modified();
147 }
149 return assignmentSolverID_;
150 }
151
152 void SetBranchDecomposition(bool branchDecomposition) {
153 branchDecomposition_ = branchDecomposition;
154 Modified();
155 }
158 }
159
160 void SetNormalizedWasserstein(bool normalizedWasserstein) {
161 normalizedWasserstein_ = normalizedWasserstein;
162 Modified();
163 }
166 }
167
168 void SetKeepSubtree(bool keepSubtree) {
169 keepSubtree_ = keepSubtree;
170 Modified();
171 }
173 return keepSubtree_;
174 }
175
176 void SetDistanceSquaredRoot(bool distanceSquaredRoot) {
177 distanceSquaredRoot_ = distanceSquaredRoot;
178 Modified();
179 }
182 }
183
184 vtkSetMacro(UseFieldDataParameters, bool);
185 vtkGetMacro(UseFieldDataParameters, bool);
186
187 vtkSetMacro(mixtureCoefficient_, double);
188 vtkGetMacro(mixtureCoefficient_, double);
189
196
197protected:
204
209 int FillInputPortInformation(int port, vtkInformation *info) override;
210
215 int FillOutputPortInformation(int port, vtkInformation *info) override;
216
221 int RequestData(vtkInformation *request,
222 vtkInformationVector **inputVector,
223 vtkInformationVector *outputVector) override;
224
225 template <class dataType>
226 int run(vtkInformationVector *outputVector,
227 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
228 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
229};
Baseclass of all VTK filters that wrap ttk modules.
Definition: ttkAlgorithm.h:34
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
Definition: ttkAlgorithm.h:390
int FillInputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
Definition: ttkAlgorithm.h:404
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
Definition: ttkAlgorithm.h:419
TTK VTK-filter that wraps the ttk::MergeTreeDistanceMatrix module.
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()
void SetDistanceSquaredRoot(bool distanceSquaredRoot)
bool epsilon1UseFarthestSaddle_
Definition: MergeTreeBase.h:27
double persistenceThreshold_
Definition: MergeTreeBase.h:34