72 bool Epsilon1UseFarthestSaddle =
false;
73 double EpsilonTree1 = 5.;
74 double EpsilonTree2 = 5.;
75 double Epsilon2Tree1 = 95.;
76 double Epsilon2Tree2 = 95.;
77 double Epsilon3Tree1 = 90.;
78 double Epsilon3Tree2 = 90.;
79 double PersistenceThreshold = 0.;
80 bool DeleteMultiPersPairs =
false;
81 bool UseMinMaxPair =
true;
82 bool IsPersistenceDiagram =
false;
87 int AssignmentSolver = 0;
88 bool BranchDecomposition =
true;
89 bool NormalizedWasserstein =
true;
90 bool KeepSubtree =
false;
91 bool oldBD = BranchDecomposition;
92 bool oldNW = NormalizedWasserstein;
93 bool oldKS = KeepSubtree;
94 double JoinSplitMixtureCoefficient = 0.5;
95 bool ComputeBarycenter =
false;
96 unsigned int NumberOfBarycenters = 1;
97 double BarycenterSizeLimitPercent = 0.0;
98 bool Deterministic =
false;
100 int branchMetric = 0;
102 double NonMatchingWeight = 1.0;
105 bool OutputTrees =
true;
106 bool OutputSegmentation =
false;
107 bool PlanarLayout =
false;
108 bool BranchDecompositionPlanarLayout =
false;
109 double BranchSpacing = 1.;
110 bool RescaleTreesIndividually =
false;
111 double DimensionSpacing = 1.;
112 int DimensionToShift = 0;
113 double ImportantPairs = 50.;
114 int MaximumImportantPairs = 0;
115 int MinimumImportantPairs = 0;
116 double ImportantPairsSpacing = 1.;
117 double NonImportantPairsSpacing = 1.;
118 double NonImportantPairsProximity = 0.05;
119 bool BarycenterPositionAlpha =
false;
120 std::string ExcludeImportantPairsLower =
"";
121 std::string ExcludeImportantPairsHigher =
"";
127 std::vector<ttk::ftm::MergeTree<double>> intermediateSTrees,
129 std::vector<vtkUnstructuredGrid *> treesNodes, treesNodes2;
130 std::vector<vtkUnstructuredGrid *> treesArcs, treesArcs2;
131 std::vector<vtkDataSet *> treesSegmentation, treesSegmentation2;
134 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>
136 std::vector<std::vector<
137 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>
138 outputMatchingBarycenter, outputMatchingBarycenter2;
141 std::vector<ttk::ftm::MergeTree<double>> barycentersS, barycentersS2;
142 std::vector<int> clusteringAssignment;
145 std::vector<std::vector<int>> trees1NodeCorrMesh, trees2NodeCorrMesh;
148 std::vector<double> finalDistances;
150 void setDataVisualization(
int numInputs,
int numInputs2) {
152 intermediateSTrees = std::vector<ttk::ftm::MergeTree<double>>(numInputs);
153 intermediateSTrees2 = std::vector<ttk::ftm::MergeTree<double>>(numInputs2);
154 treesNodes = std::vector<vtkUnstructuredGrid *>(numInputs);
155 treesNodes2 = std::vector<vtkUnstructuredGrid *>(numInputs2);
156 treesArcs = std::vector<vtkUnstructuredGrid *>(numInputs);
157 treesArcs2 = std::vector<vtkUnstructuredGrid *>(numInputs2);
158 treesSegmentation = std::vector<vtkDataSet *>(numInputs);
159 treesSegmentation2 = std::vector<vtkDataSet *>(numInputs2);
162 outputMatchingBarycenter = std::vector<std::vector<
163 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>(
166 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>(
169 outputMatchingBarycenter2 = std::vector<std::vector<
170 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>(
173 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>(
178 = std::vector<ttk::ftm::MergeTree<double>>(NumberOfBarycenters);
179 clusteringAssignment = std::vector<int>(numInputs, 0);
182 void resetDataVisualization() {
183 setDataVisualization(0, 0);
184 trees1NodeCorrMesh = std::vector<std::vector<int>>();
185 trees2NodeCorrMesh = std::vector<std::vector<int>>();
186 finalDistances = std::vector<double>();
189 bool isDataVisualizationFilled() {
190 return trees1NodeCorrMesh.size() != 0 and finalDistances.size() != 0;
200 Epsilon1UseFarthestSaddle = epsilon1UseFarthestSaddle;
202 resetDataVisualization();
204 vtkGetMacro(Epsilon1UseFarthestSaddle,
bool);
207 EpsilonTree1 = epsilonTree1;
209 resetDataVisualization();
211 vtkGetMacro(EpsilonTree1,
double);
214 Epsilon2Tree1 = epsilon2Tree1;
216 resetDataVisualization();
218 vtkGetMacro(Epsilon2Tree1,
double);
221 Epsilon3Tree1 = epsilon3Tree1;
223 resetDataVisualization();
225 vtkGetMacro(Epsilon3Tree1,
double);
228 PersistenceThreshold = persistenceThreshold;
230 resetDataVisualization();
232 vtkGetMacro(PersistenceThreshold,
double);
235 UseMinMaxPair = useMinMaxPair;
237 resetDataVisualization();
239 vtkGetMacro(UseMinMaxPair,
bool);
242 DeleteMultiPersPairs = deleteMultiPersPairs;
244 resetDataVisualization();
246 vtkGetMacro(DeleteMultiPersPairs,
bool);
251 oldBD = BranchDecomposition;
252 oldNW = NormalizedWasserstein;
255 if(newBackend == 2) {
256 BranchDecomposition = oldBD;
257 NormalizedWasserstein = oldNW;
260 Backend = newBackend;
262 resetDataVisualization();
264 vtkGetMacro(Backend,
int);
268 Alpha = std::min(1 - 1e-6, Alpha);
269 Alpha = std::max(1e-6, Alpha);
271 resetDataVisualization();
273 vtkGetMacro(Alpha,
double);
276 AssignmentSolver = assignmentSolver;
278 resetDataVisualization();
280 vtkGetMacro(AssignmentSolver,
int);
283 BranchDecomposition = branchDecomposition;
285 resetDataVisualization();
287 vtkGetMacro(BranchDecomposition,
bool);
290 Deterministic = deterministic;
292 resetDataVisualization();
294 vtkGetMacro(Deterministic,
bool);
297 NormalizedWasserstein = normalizedWasserstein;
299 resetDataVisualization();
301 vtkGetMacro(NormalizedWasserstein,
bool);
304 KeepSubtree = keepSubtree;
306 resetDataVisualization();
308 vtkGetMacro(KeepSubtree,
bool);
311 JoinSplitMixtureCoefficient = joinSplitMixtureCoefficient;
313 resetDataVisualization();
315 vtkGetMacro(JoinSplitMixtureCoefficient,
double);
318 ComputeBarycenter = computeBarycenter;
320 resetDataVisualization();
322 vtkGetMacro(ComputeBarycenter,
bool);
325 NumberOfBarycenters = numberOfBarycenters;
327 resetDataVisualization();
329 vtkGetMacro(NumberOfBarycenters,
unsigned int);
332 BarycenterSizeLimitPercent = percent;
334 resetDataVisualization();
336 vtkGetMacro(BarycenterSizeLimitPercent,
double);
349 NonMatchingWeight = weight;
351 resetDataVisualization();
353 vtkGetMacro(NonMatchingWeight,
double);
356 vtkSetMacro(BarycenterPositionAlpha,
bool);
357 vtkGetMacro(BarycenterPositionAlpha,
bool);
359 vtkSetMacro(OutputTrees,
bool);
360 vtkGetMacro(OutputTrees,
bool);
362 vtkSetMacro(OutputSegmentation,
bool);
363 vtkGetMacro(OutputSegmentation,
bool);
365 vtkSetMacro(PlanarLayout,
bool);
366 vtkGetMacro(PlanarLayout,
bool);
368 vtkSetMacro(BranchDecompositionPlanarLayout,
bool);
369 vtkGetMacro(BranchDecompositionPlanarLayout,
bool);
371 vtkSetMacro(BranchSpacing,
double);
372 vtkGetMacro(BranchSpacing,
double);
374 vtkSetMacro(RescaleTreesIndividually,
bool);
375 vtkGetMacro(RescaleTreesIndividually,
bool);
377 vtkSetMacro(DimensionSpacing,
double);
378 vtkGetMacro(DimensionSpacing,
double);
380 vtkSetMacro(DimensionToShift,
int);
381 vtkGetMacro(DimensionToShift,
int);
383 vtkSetMacro(ImportantPairs,
double);
384 vtkGetMacro(ImportantPairs,
double);
386 vtkSetMacro(MaximumImportantPairs,
int);
387 vtkGetMacro(MaximumImportantPairs,
int);
389 vtkSetMacro(MinimumImportantPairs,
int);
390 vtkGetMacro(MinimumImportantPairs,
int);
392 vtkSetMacro(ImportantPairsSpacing,
double);
393 vtkGetMacro(ImportantPairsSpacing,
double);
395 vtkSetMacro(NonImportantPairsSpacing,
double);
396 vtkGetMacro(NonImportantPairsSpacing,
double);
398 vtkSetMacro(NonImportantPairsProximity,
double);
399 vtkGetMacro(NonImportantPairsProximity,
double);
401 vtkSetMacro(ExcludeImportantPairsLower,
const std::string &);
402 vtkGetMacro(ExcludeImportantPairsLower, std::string);
404 vtkSetMacro(ExcludeImportantPairsHigher,
const std::string &);
405 vtkGetMacro(ExcludeImportantPairsHigher, std::string);
439 vtkInformationVector **inputVector,
440 vtkInformationVector *outputVector)
override;
442 template <
class dataType>
443 int run(vtkInformationVector *outputVector,
447 template <
class dataType>
449 vtkInformationVector *outputVector,
453 template <
class dataType>
455 vtkInformationVector *outputVector,