69 bool Epsilon1UseFarthestSaddle =
false;
70 double EpsilonTree1 = 5.;
71 double EpsilonTree2 = 5.;
72 double Epsilon2Tree1 = 95.;
73 double Epsilon2Tree2 = 95.;
74 double Epsilon3Tree1 = 90.;
75 double Epsilon3Tree2 = 90.;
76 double PersistenceThreshold = 0.;
77 bool DeleteMultiPersPairs =
false;
78 bool UseMinMaxPair =
true;
79 bool IsPersistenceDiagram =
false;
84 int AssignmentSolver = 0;
85 bool BranchDecomposition =
true;
86 bool NormalizedWasserstein =
true;
87 bool KeepSubtree =
false;
88 bool oldBD = BranchDecomposition;
89 bool oldNW = NormalizedWasserstein;
90 bool oldKS = KeepSubtree;
91 double JoinSplitMixtureCoefficient = 0.5;
92 bool ComputeBarycenter =
false;
93 unsigned int NumberOfBarycenters = 1;
94 double BarycenterSizeLimitPercent = 0.0;
95 bool Deterministic =
false;
99 double NonMatchingWeight = 1.0;
102 bool OutputTrees =
true;
103 bool OutputSegmentation =
false;
104 bool PlanarLayout =
false;
105 bool BranchDecompositionPlanarLayout =
false;
106 double BranchSpacing = 1.;
107 bool RescaleTreesIndividually =
false;
108 double DimensionSpacing = 1.;
109 int DimensionToShift = 0;
110 double ImportantPairs = 50.;
111 int MaximumImportantPairs = 0;
112 int MinimumImportantPairs = 0;
113 double ImportantPairsSpacing = 1.;
114 double NonImportantPairsSpacing = 1.;
115 double NonImportantPairsProximity = 0.05;
116 bool BarycenterPositionAlpha =
false;
117 std::string ExcludeImportantPairsLower =
"";
118 std::string ExcludeImportantPairsHigher =
"";
124 std::vector<ttk::ftm::MergeTree<double>> intermediateSTrees,
126 std::vector<vtkUnstructuredGrid *> treesNodes, treesNodes2;
127 std::vector<vtkUnstructuredGrid *> treesArcs, treesArcs2;
128 std::vector<vtkDataSet *> treesSegmentation, treesSegmentation2;
131 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>
133 std::vector<std::vector<
134 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>
135 outputMatchingBarycenter, outputMatchingBarycenter2;
138 std::vector<ttk::ftm::MergeTree<double>> barycentersS, barycentersS2;
139 std::vector<int> clusteringAssignment;
142 std::vector<std::vector<int>> trees1NodeCorrMesh, trees2NodeCorrMesh;
145 std::vector<double> finalDistances;
147 void setDataVisualization(
int numInputs,
int numInputs2) {
149 intermediateSTrees = std::vector<ttk::ftm::MergeTree<double>>(numInputs);
150 intermediateSTrees2 = std::vector<ttk::ftm::MergeTree<double>>(numInputs2);
151 treesNodes = std::vector<vtkUnstructuredGrid *>(numInputs);
152 treesNodes2 = std::vector<vtkUnstructuredGrid *>(numInputs2);
153 treesArcs = std::vector<vtkUnstructuredGrid *>(numInputs);
154 treesArcs2 = std::vector<vtkUnstructuredGrid *>(numInputs2);
155 treesSegmentation = std::vector<vtkDataSet *>(numInputs);
156 treesSegmentation2 = std::vector<vtkDataSet *>(numInputs2);
159 outputMatchingBarycenter = std::vector<std::vector<
160 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>(
163 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>(
166 outputMatchingBarycenter2 = std::vector<std::vector<
167 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>>(
170 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>(
175 = std::vector<ttk::ftm::MergeTree<double>>(NumberOfBarycenters);
176 clusteringAssignment = std::vector<int>(numInputs, 0);
179 void resetDataVisualization() {
180 setDataVisualization(0, 0);
181 trees1NodeCorrMesh = std::vector<std::vector<int>>();
182 trees2NodeCorrMesh = std::vector<std::vector<int>>();
183 finalDistances = std::vector<double>();
186 bool isDataVisualizationFilled() {
187 return trees1NodeCorrMesh.size() != 0 and finalDistances.size() != 0;
197 Epsilon1UseFarthestSaddle = epsilon1UseFarthestSaddle;
199 resetDataVisualization();
201 vtkGetMacro(Epsilon1UseFarthestSaddle,
bool);
204 EpsilonTree1 = epsilonTree1;
206 resetDataVisualization();
208 vtkGetMacro(EpsilonTree1,
double);
211 Epsilon2Tree1 = epsilon2Tree1;
213 resetDataVisualization();
215 vtkGetMacro(Epsilon2Tree1,
double);
218 Epsilon3Tree1 = epsilon3Tree1;
220 resetDataVisualization();
222 vtkGetMacro(Epsilon3Tree1,
double);
225 PersistenceThreshold = persistenceThreshold;
227 resetDataVisualization();
229 vtkGetMacro(PersistenceThreshold,
double);
232 UseMinMaxPair = useMinMaxPair;
234 resetDataVisualization();
236 vtkGetMacro(UseMinMaxPair,
bool);
239 DeleteMultiPersPairs = deleteMultiPersPairs;
241 resetDataVisualization();
243 vtkGetMacro(DeleteMultiPersPairs,
bool);
248 oldBD = BranchDecomposition;
249 oldNW = NormalizedWasserstein;
252 if(newBackend == 2) {
253 BranchDecomposition = oldBD;
254 NormalizedWasserstein = oldNW;
257 Backend = newBackend;
259 resetDataVisualization();
261 vtkGetMacro(Backend,
int);
265 Alpha = std::min(1 - 1e-6, Alpha);
266 Alpha = std::max(1e-6, Alpha);
268 resetDataVisualization();
270 vtkGetMacro(Alpha,
double);
273 AssignmentSolver = assignmentSolver;
275 resetDataVisualization();
277 vtkGetMacro(AssignmentSolver,
int);
280 BranchDecomposition = branchDecomposition;
282 resetDataVisualization();
284 vtkGetMacro(BranchDecomposition,
bool);
287 Deterministic = deterministic;
289 resetDataVisualization();
291 vtkGetMacro(Deterministic,
bool);
294 NormalizedWasserstein = normalizedWasserstein;
296 resetDataVisualization();
298 vtkGetMacro(NormalizedWasserstein,
bool);
301 KeepSubtree = keepSubtree;
303 resetDataVisualization();
305 vtkGetMacro(KeepSubtree,
bool);
308 JoinSplitMixtureCoefficient = joinSplitMixtureCoefficient;
310 resetDataVisualization();
312 vtkGetMacro(JoinSplitMixtureCoefficient,
double);
315 ComputeBarycenter = computeBarycenter;
317 resetDataVisualization();
319 vtkGetMacro(ComputeBarycenter,
bool);
322 NumberOfBarycenters = numberOfBarycenters;
324 resetDataVisualization();
326 vtkGetMacro(NumberOfBarycenters,
unsigned int);
329 BarycenterSizeLimitPercent = percent;
331 resetDataVisualization();
333 vtkGetMacro(BarycenterSizeLimitPercent,
double);
346 NonMatchingWeight = weight;
348 resetDataVisualization();
350 vtkGetMacro(NonMatchingWeight,
double);
353 vtkSetMacro(BarycenterPositionAlpha,
bool);
354 vtkGetMacro(BarycenterPositionAlpha,
bool);
356 vtkSetMacro(OutputTrees,
bool);
357 vtkGetMacro(OutputTrees,
bool);
359 vtkSetMacro(OutputSegmentation,
bool);
360 vtkGetMacro(OutputSegmentation,
bool);
362 vtkSetMacro(PlanarLayout,
bool);
363 vtkGetMacro(PlanarLayout,
bool);
365 vtkSetMacro(BranchDecompositionPlanarLayout,
bool);
366 vtkGetMacro(BranchDecompositionPlanarLayout,
bool);
368 vtkSetMacro(BranchSpacing,
double);
369 vtkGetMacro(BranchSpacing,
double);
371 vtkSetMacro(RescaleTreesIndividually,
bool);
372 vtkGetMacro(RescaleTreesIndividually,
bool);
374 vtkSetMacro(DimensionSpacing,
double);
375 vtkGetMacro(DimensionSpacing,
double);
377 vtkSetMacro(DimensionToShift,
int);
378 vtkGetMacro(DimensionToShift,
int);
380 vtkSetMacro(ImportantPairs,
double);
381 vtkGetMacro(ImportantPairs,
double);
383 vtkSetMacro(MaximumImportantPairs,
int);
384 vtkGetMacro(MaximumImportantPairs,
int);
386 vtkSetMacro(MinimumImportantPairs,
int);
387 vtkGetMacro(MinimumImportantPairs,
int);
389 vtkSetMacro(ImportantPairsSpacing,
double);
390 vtkGetMacro(ImportantPairsSpacing,
double);
392 vtkSetMacro(NonImportantPairsSpacing,
double);
393 vtkGetMacro(NonImportantPairsSpacing,
double);
395 vtkSetMacro(NonImportantPairsProximity,
double);
396 vtkGetMacro(NonImportantPairsProximity,
double);
398 vtkSetMacro(ExcludeImportantPairsLower,
const std::string &);
399 vtkGetMacro(ExcludeImportantPairsLower, std::string);
401 vtkSetMacro(ExcludeImportantPairsHigher,
const std::string &);
402 vtkGetMacro(ExcludeImportantPairsHigher, std::string);
436 vtkInformationVector **inputVector,
437 vtkInformationVector *outputVector)
override;
439 template <
class dataType>
440 int run(vtkInformationVector *outputVector,
444 template <
class dataType>
446 vtkInformationVector *outputVector,
450 template <
class dataType>
452 vtkInformationVector *outputVector,