TTK
Loading...
Searching...
No Matches
ttkDimensionReduction.h
Go to the documentation of this file.
1
48
54
55#pragma once
56
57// VTK Module
58#include <ttkDimensionReductionModule.h>
59
60// TTK includes
61#include <DimensionReduction.h>
62#include <TopoMap.h>
63#include <ttkAlgorithm.h>
64#include <ttkMacros.h>
65
66class TTKDIMENSIONREDUCTION_EXPORT ttkDimensionReduction
67 : public ttkAlgorithm,
68 protected ttk::DimensionReduction {
69
70public:
73
74 void SetScalarFields(const std::string &s) {
75 ScalarFields.push_back(s);
76 Modified();
77 }
78
80 ScalarFields.clear();
81 Modified();
82 }
83
84 // default
85 vtkSetMacro(SelectFieldsWithRegexp, bool);
86 vtkGetMacro(SelectFieldsWithRegexp, bool);
87
88 vtkSetMacro(RegexpString, const std::string &);
89 vtkGetMacro(RegexpString, std::string);
90
91 vtkSetMacro(NumberOfComponents, int);
92 vtkGetMacro(NumberOfComponents, int);
93
94 vtkSetMacro(NumberOfNeighbors, int);
95 vtkGetMacro(NumberOfNeighbors, int);
96
97 vtkSetMacro(IsDeterministic, int);
98 vtkGetMacro(IsDeterministic, int);
99
101 vtkGetEnumMacro(Method, METHOD);
102
103 vtkSetMacro(KeepAllDataArrays, bool);
104 vtkGetMacro(KeepAllDataArrays, bool);
105
106 // SE && MDS
107 void SetInputIsADistanceMatrix(const bool b) {
108 this->InputIsADistanceMatrix = b;
110 Modified();
111 }
112 vtkGetMacro(InputIsADistanceMatrix, bool);
113
114 // SE
115 vtkSetMacro(se_Affinity, const std::string &);
116 vtkGetMacro(se_Affinity, std::string);
117
118 vtkSetMacro(se_Gamma, float);
119 vtkGetMacro(se_Gamma, float);
120
121 vtkSetMacro(se_EigenSolver, const std::string &);
122 vtkGetMacro(se_EigenSolver, std::string);
123
124 // LLE
125 vtkSetMacro(lle_Regularization, float);
126 vtkGetMacro(lle_Regularization, float);
127
128 vtkSetMacro(lle_EigenSolver, const std::string &);
129 vtkGetMacro(lle_EigenSolver, std::string);
130
131 vtkSetMacro(lle_Tolerance, float);
132 vtkGetMacro(lle_Tolerance, float);
133
134 vtkSetMacro(lle_MaxIteration, int);
135 vtkGetMacro(lle_MaxIteration, int);
136
137 vtkSetMacro(lle_Method, const std::string &);
138 vtkGetMacro(lle_Method, std::string);
139
140 vtkSetMacro(lle_HessianTolerance, float);
141 vtkGetMacro(lle_HessianTolerance, float);
142
143 vtkSetMacro(lle_ModifiedTolerance, float);
144 vtkGetMacro(lle_ModifiedTolerance, float);
145
146 vtkSetMacro(lle_NeighborsAlgorithm, const std::string &);
147 vtkGetMacro(lle_NeighborsAlgorithm, std::string);
148
149 // MDS
150 vtkSetMacro(mds_Metric, bool);
151 vtkGetMacro(mds_Metric, bool);
152
153 vtkSetMacro(mds_Init, int);
154 vtkGetMacro(mds_Init, int);
155
156 vtkSetMacro(mds_MaxIteration, int);
157 vtkGetMacro(mds_MaxIteration, int);
158
159 vtkSetMacro(mds_Verbose, int);
160 vtkGetMacro(mds_Verbose, int);
161
162 vtkSetMacro(mds_Epsilon, float);
163 vtkGetMacro(mds_Epsilon, float);
164
165 // TSNE
166 vtkSetMacro(tsne_Perplexity, float);
167 vtkGetMacro(tsne_Perplexity, float);
168
169 vtkSetMacro(tsne_Exaggeration, float);
170 vtkGetMacro(tsne_Exaggeration, float);
171
172 vtkSetMacro(tsne_LearningRate, float);
173 vtkGetMacro(tsne_LearningRate, float);
174
175 vtkSetMacro(tsne_MaxIteration, int);
176 vtkGetMacro(tsne_MaxIteration, int);
177
178 vtkSetMacro(tsne_MaxIterationProgress, int);
179 vtkGetMacro(tsne_MaxIterationProgress, int);
180
181 vtkSetMacro(tsne_GradientThreshold, float);
182 vtkGetMacro(tsne_GradientThreshold, float);
183
184 vtkSetMacro(tsne_Metric, const std::string &);
185 vtkGetMacro(tsne_Metric, std::string);
186
187 vtkSetMacro(tsne_Init, const std::string &);
188 vtkGetMacro(tsne_Init, std::string);
189
190 vtkSetMacro(tsne_Verbose, int);
191 vtkGetMacro(tsne_Verbose, int);
192
193 vtkSetMacro(tsne_Method, const std::string &);
194 vtkGetMacro(tsne_Method, std::string);
195
196 vtkSetMacro(tsne_Angle, float);
197 vtkGetMacro(tsne_Angle, float);
198
199 // Iso
200 vtkSetMacro(iso_EigenSolver, const std::string &);
201 vtkGetMacro(iso_EigenSolver, std::string);
202
203 vtkSetMacro(iso_Tolerance, float);
204 vtkGetMacro(iso_Tolerance, float);
205
206 vtkSetMacro(iso_MaxIteration, int);
207 vtkGetMacro(iso_MaxIteration, int);
208
209 vtkSetMacro(iso_PathMethod, const std::string &);
210 vtkGetMacro(iso_PathMethod, std::string);
211
212 vtkSetMacro(iso_NeighborsAlgorithm, const std::string &);
213 vtkGetMacro(iso_NeighborsAlgorithm, std::string);
214
215 vtkSetMacro(iso_Metric, const std::string &);
216 vtkGetMacro(iso_Metric, std::string);
217
218 // PCA
219 vtkSetMacro(pca_Copy, bool);
220 vtkGetMacro(pca_Copy, bool);
221
222 vtkSetMacro(pca_Whiten, bool);
223 vtkGetMacro(pca_Whiten, bool);
224
225 vtkSetMacro(pca_SVDSolver, const std::string &);
226 vtkGetMacro(pca_SVDSolver, std::string);
227
228 vtkSetMacro(pca_Tolerance, float);
229 vtkGetMacro(pca_Tolerance, float);
230
231 vtkSetMacro(pca_MaxIteration, const std::string &);
232 vtkGetMacro(pca_MaxIteration, std::string);
233
234 // TopoMap
235 vtkSetMacro(topomap_AngularSampleNb, unsigned long int);
236 vtkGetMacro(topomap_AngularSampleNb, unsigned long int);
237
238 vtkSetMacro(topomap_CheckMST, bool);
239 vtkGetMacro(topomap_CheckMST, bool);
240
242 vtkGetEnumMacro(topomap_Strategy, ttk::TopoMap::STRATEGY);
243
244 // testing
245 vtkSetMacro(ModulePath, const std::string &);
246 vtkGetMacro(ModulePath, std::string);
247
248 vtkSetMacro(ModuleName, const std::string &);
249 vtkGetMacro(ModuleName, std::string);
250
251 vtkSetMacro(FunctionName, const std::string &);
252 vtkGetMacro(FunctionName, std::string);
253
254protected:
256
257 int FillInputPortInformation(int port, vtkInformation *info) override;
258 int FillOutputPortInformation(int port, vtkInformation *info) override;
259 int RequestData(vtkInformation *request,
260 vtkInformationVector **inputVector,
261 vtkInformationVector *outputVector) override;
262
263private:
264 // default
265 bool SelectFieldsWithRegexp{false};
266 std::string RegexpString{".*"};
267 std::vector<std::string> ScalarFields{};
268
269 bool KeepAllDataArrays{true};
270
271 // mds && se
272 bool InputIsADistanceMatrix{false};
273
274 std::vector<std::vector<double>> outputData_{};
275};
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 VTK-filter that wraps the ttk::DimensionReduction processing package.
static ttkDimensionReduction * New()
void SetScalarFields(const std::string &s)
void SetInputIsADistanceMatrix(const bool b)
TTK VTK-filter that apply dimension reduction algorithms on input.
void setIsInputDistanceMatrix(const bool data)
#define ttkSetEnumMacro(name, enumType)
Definition ttkMacros.h:38