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