TTK
Loading...
Searching...
No Matches
ttkMergeTreePrincipalGeodesics.h
Go to the documentation of this file.
1
45
46#pragma once
47
48// VTK Module
49#include <ttkMergeTreePrincipalGeodesicsModule.h>
50
51// VTK Includes
52#include <ttkAlgorithm.h>
53#include <vtkMultiBlockDataSet.h>
54#include <vtkUnstructuredGrid.h>
55
56// TTK Base Includes
57#include <FTMTree.h>
60
61class TTKMERGETREEPRINCIPALGEODESICS_EXPORT ttkMergeTreePrincipalGeodesics
62 : public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
63 ,
64 protected ttk::MergeTreePrincipalGeodesics // and we inherit from the base
65 // class
66{
67private:
72 // Input options
73 double oldEpsilonTree1;
74 // Output options
75
76 // ----------------------
77 // Data for visualization
78 // ----------------------
79 // Trees
80 std::vector<ttk::ftm::MergeTree<double>> intermediateDTrees;
81 std::vector<vtkUnstructuredGrid *> treesNodes, treesNodes2;
82 std::vector<vtkUnstructuredGrid *> treesArcs, treesArcs2;
83 std::vector<vtkDataSet *> treesSegmentation, treesSegmentation2;
84 // Output
85 // -> base class
86
87 void setDataVisualization(int ttkNotUsed(numInputs),
88 int ttkNotUsed(numInputs2)) {
89 }
90
91 void resetDataVisualization() {
92 setDataVisualization(0, 0);
93 if(not keepState_) {
94 barycenter_ = ttk::ftm::MergeTree<double>();
95 allTs_.clear();
96 }
97 }
98
99 bool isDataVisualizationFilled() {
100 return allTs_.size() != 0 and not keepState_;
101 }
102
103public:
108 // Input Options
110 normalizedWasserstein_ = nW;
111 Modified();
112 resetDataVisualization();
113 }
117
118 void SetNumberOfGeodesics(unsigned int numberOfGeodesics) {
119 numberOfAxes_ = numberOfGeodesics;
120 Modified();
121 resetDataVisualization();
122 }
123 unsigned int GetNumberOfGeodesics() {
124 return numberOfAxes_;
125 }
126
127 void SetNumberOfProjectionIntervals(unsigned int intervals) {
128 k_ = intervals;
129 Modified();
130 resetDataVisualization();
131 }
133 return k_;
134 }
135
136 void SetNumberOfProjectionSteps(unsigned int steps) {
137 noProjectionStep_ = steps;
138 Modified();
139 resetDataVisualization();
140 }
142 return noProjectionStep_;
143 }
144
145 void SetBarycenterSizeLimitPercent(double percent) {
146 barycenterSizeLimitPercent_ = percent;
147 Modified();
148 resetDataVisualization();
149 }
153
154 void SetDeterministic(bool deterministic) {
155 deterministic_ = deterministic;
156 Modified();
157 resetDataVisualization();
158 }
160 return deterministic_;
161 }
162
163 void SetJoinSplitMixtureCoefficient(double joinSplitMixtureCoefficient) {
164 mixtureCoefficient_ = joinSplitMixtureCoefficient;
165 Modified();
166 resetDataVisualization();
167 }
171
172 void SetKeepState(bool keepState) {
173 keepState_ = keepState;
174 Modified();
175 resetDataVisualization();
176 }
178 return keepState_;
179 }
180
181 void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle) {
182 epsilon1UseFarthestSaddle_ = epsilon1UseFarthestSaddle;
183 Modified();
184 resetDataVisualization();
185 }
189
190 void SetEpsilonTree1(double epsilonTree1) {
191 epsilonTree1_ = epsilonTree1;
192 oldEpsilonTree1 = epsilonTree1_;
193 Modified();
194 resetDataVisualization();
195 }
197 return epsilonTree1_;
198 }
199
200 void SetEpsilon2Tree1(double epsilon2Tree1) {
201 epsilon2Tree1_ = epsilon2Tree1;
202 Modified();
203 resetDataVisualization();
204 }
206 return epsilon2Tree1_;
207 }
208
209 void SetEpsilon3Tree1(double epsilon3Tree1) {
210 epsilon3Tree1_ = epsilon3Tree1;
211 Modified();
212 resetDataVisualization();
213 }
215 return epsilon3Tree1_;
216 }
217
218 void SetPersistenceThreshold(double persistenceThreshold) {
219 persistenceThreshold_ = persistenceThreshold;
220 Modified();
221 resetDataVisualization();
222 }
225 }
226
227 void SetDeleteMultiPersPairs(bool delMultiPersPairs) {
228 deleteMultiPersPairs_ = delMultiPersPairs;
229 Modified();
230 resetDataVisualization();
231 }
235
236 // Output options
238 doComputeReconstructionError_ = b;
239 Modified();
240 resetDataVisualization();
241 }
245
252
253protected:
259
264 int FillInputPortInformation(int port, vtkInformation *info) override;
265
270 int FillOutputPortInformation(int port, vtkInformation *info) override;
271
276 int RequestData(vtkInformation *request,
277 vtkInformationVector **inputVector,
278 vtkInformationVector *outputVector) override;
279
280 template <class dataType>
281 int run(vtkInformationVector *outputVector,
282 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
283 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
284
285 template <class dataType>
287 vtkInformationVector *outputVector,
288 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
289 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
290
291 template <class dataType>
292 int runOutput(
293 vtkInformationVector *outputVector,
294 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees,
295 std::vector<vtkSmartPointer<vtkMultiBlockDataSet>> &inputTrees2);
296
297 template <class dataType>
298 void makeBarycenterOutput(ttk::ftm::MergeTree<dataType> &barycenter,
299 int blockId,
300 vtkMultiBlockDataSet *output_barycenter);
301};
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
Definition BaseClass.h:47
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::MergeTreePrincipalGeodesics module.
int runCompute(vtkInformationVector *outputVector, std::vector< vtkSmartPointer< vtkMultiBlockDataSet > > &inputTrees, std::vector< vtkSmartPointer< vtkMultiBlockDataSet > > &inputTrees2)
void SetJoinSplitMixtureCoefficient(double joinSplitMixtureCoefficient)
void SetDeleteMultiPersPairs(bool delMultiPersPairs)
void SetNumberOfGeodesics(unsigned int numberOfGeodesics)
static ttkMergeTreePrincipalGeodesics * New()
void SetNumberOfProjectionIntervals(unsigned int intervals)
void SetEpsilon1UseFarthestSaddle(bool epsilon1UseFarthestSaddle)
void SetPersistenceThreshold(double persistenceThreshold)