TTK
Loading...
Searching...
No Matches
ttkPersistenceDiagramDistanceMatrix.h
Go to the documentation of this file.
1
22
23#pragma once
24
25// VTK includes
26#include <vtkInformation.h>
27#include <vtkInformationVector.h>
28
29// VTK Module
30#include <ttkPersistenceDiagramDistanceMatrixModule.h>
31
32// ttk code includes
34#include <ttkAlgorithm.h>
35
36class TTKPERSISTENCEDIAGRAMDISTANCEMATRIX_EXPORT
38 : public ttkAlgorithm,
40
41public:
43
45
46 void SetWassersteinMetric(const std::string &data) {
47 Wasserstein = (data == "inf") ? -1 : stoi(data);
48 Modified();
49 }
50 std::string GetWassersteinMetric() {
51 return Wasserstein == -1 ? "inf" : std::to_string(Wasserstein);
52 }
53
54 void SetAntiAlpha(double data) {
55 data = 1 - data;
56 if(data > 0 && data <= 1) {
57 Alpha = data;
58 } else if(data > 1) {
59 Alpha = 1;
60 } else {
61 Alpha = 0.001;
62 }
63 Modified();
64 }
65 vtkGetMacro(Alpha, double);
66
67 vtkSetMacro(DeltaLim, double);
68 vtkGetMacro(DeltaLim, double);
69
70 vtkSetMacro(Lambda, double);
71 vtkGetMacro(Lambda, double);
72
73 void SetPairType(const int data) {
74 switch(data) {
75 case(0):
76 this->setDos(true, false, false);
77 break;
78 case(1):
79 this->setDos(false, true, false);
80 break;
81 case(2):
82 this->setDos(false, false, true);
83 break;
84 default:
85 this->setDos(true, true, true);
86 break;
87 }
88 Modified();
89 }
91 if(do_min_ && do_sad_ && do_max_) {
92 return -1;
93 } else if(do_min_) {
94 return 0;
95 } else if(do_sad_) {
96 return 1;
97 } else if(do_max_) {
98 return 2;
99 }
100 return -1;
101 }
102
103 void SetConstraint(const int arg_) {
104 this->setConstraint(arg_);
105 this->Modified();
106 }
108 switch(this->Constraint) {
110 return 0;
112 return 1;
114 return 2;
116 return 3;
118 return 4;
119 }
120 return -1;
121 }
122
123 vtkSetMacro(MaxNumberOfPairs, unsigned int);
124 vtkGetMacro(MaxNumberOfPairs, unsigned int);
125
126 vtkSetMacro(MinPersistence, double);
127 vtkGetMacro(MinPersistence, double);
128
129protected:
132
133 int FillInputPortInformation(int port, vtkInformation *info) override;
134 int FillOutputPortInformation(int port, vtkInformation *info) override;
135
136 int RequestData(vtkInformation *request,
137 vtkInformationVector **inputVector,
138 vtkInformationVector *outputVector) override;
139};
Baseclass of all VTK filters that wrap ttk modules.
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
TTK processing package for the computation of a matrix of Wasserstein distances between persistence d...
~ttkPersistenceDiagramDistanceMatrix() override=default
static ttkPersistenceDiagramDistanceMatrix * New()
void setDos(const bool min, const bool sad, const bool max)