51class TTKMERGETREEPRINCIPALGEODESICSDECODING_EXPORT
65 bool OutputInputTrees =
false;
66 bool OutputInputTreesSegmentation =
false;
67 bool OutputBarycenter =
true;
68 bool ReconstructInputTrees =
true;
69 bool ConstructGeodesicsTrees =
false;
70 bool ConstructEllipses =
false;
71 bool ConstructRectangle =
false;
72 unsigned int RectangleMultiplier = 1;
73 bool ConstructSurface =
false;
74 bool ProcessSecondInput =
false;
80 std::vector<ttk::ftm::MergeTree<double>> baryMTree, inputMTrees;
81 std::vector<vtkUnstructuredGrid *> baryTreeNodes, inputTreesNodes;
82 std::vector<vtkUnstructuredGrid *> baryTreeArcs, inputTreesArcs;
83 std::vector<vtkDataSet *> baryTreeSegmentation, inputTreesSegmentation;
85 bool processFirstInput;
86 std::vector<ttk::ftm::MergeTree<double>> reconstructedTrees;
87 std::vector<double> reconstructionErrors;
89 std::vector<std::tuple<ttk::ftm::idNode, ttk::ftm::idNode, double>>>
90 recInputMatchings, recBaryMatchings;
91 std::vector<std::vector<ttk::ftm::MergeTree<double>>> geodesicsTrees;
92 std::vector<ttk::ftm::MergeTree<double>> geodesicsEllipses,
93 geodesicsRectangle, geodesicsSurface;
94 vtkFieldData *inputFieldData;
96 vtkMTimeType tableCoefficientsMTime, tableVectorsMTime, tableCorrelationMTime,
99 void setDataVisualization(
int numTrees) {
102 baryTreeNodes.resize(1);
103 baryTreeArcs.resize(1);
104 baryTreeSegmentation.resize(1);
106 inputMTrees.resize(numTrees);
107 inputTreesNodes.resize(numTrees);
108 inputTreesArcs.resize(numTrees);
109 inputTreesSegmentation.resize(numTrees);
112 bool isDataVisualizationFilled() {
113 return (ReconstructInputTrees == (reconstructedTrees.size() != 0))
114 and (ConstructGeodesicsTrees == (geodesicsTrees.size() != 0))
115 and (ConstructEllipses == (geodesicsEllipses.size() != 0))
116 and (ConstructRectangle == (geodesicsRectangle.size() != 0))
117 and (ConstructSurface == (geodesicsSurface.size() != 0))
118 and (not OutputInputTrees) and geodesicsDistances_.size() != 0;
121 void resetDataVisualization() {
122 setDataVisualization(0);
123 reconstructedTrees.clear();
124 geodesicsTrees.clear();
125 geodesicsEllipses.clear();
126 geodesicsRectangle.clear();
127 geodesicsSurface.clear();
128 geodesicsDistances_.clear();
140 resetDataVisualization();
148 vtkSetMacro(OutputInputTrees,
bool);
149 vtkGetMacro(OutputInputTrees,
bool);
151 vtkSetMacro(OutputInputTreesSegmentation,
bool);
152 vtkGetMacro(OutputInputTreesSegmentation,
bool);
154 vtkSetMacro(OutputBarycenter,
bool);
155 vtkGetMacro(OutputBarycenter,
bool);
157 vtkSetMacro(ReconstructInputTrees,
bool);
158 vtkGetMacro(ReconstructInputTrees,
bool);
161 computeReconstructionError_ = b;
163 resetDataVisualization();
165 vtkGetMacro(computeReconstructionError_,
bool);
168 transferInputTreesInformation_ = b;
170 resetDataVisualization();
172 vtkGetMacro(transferInputTreesInformation_,
bool);
175 transferBarycenterInformation_ = b;
177 resetDataVisualization();
179 vtkGetMacro(transferBarycenterInformation_,
bool);
181 vtkSetMacro(ConstructGeodesicsTrees,
bool);
182 vtkGetMacro(ConstructGeodesicsTrees,
bool);
184 vtkSetMacro(ConstructEllipses,
bool);
185 vtkGetMacro(ConstructEllipses,
bool);
187 vtkSetMacro(ConstructRectangle,
bool);
188 vtkGetMacro(ConstructRectangle,
bool);
191 RectangleMultiplier = mult;
193 geodesicsRectangle.clear();
195 vtkGetMacro(RectangleMultiplier,
unsigned int);
197 vtkSetMacro(ConstructSurface,
bool);
198 vtkGetMacro(ConstructSurface,
bool);
201 ProcessSecondInput = b;
203 resetDataVisualization();
205 vtkGetMacro(ProcessSecondInput,
bool);
238 vtkInformationVector **inputVector,
239 vtkInformationVector *outputVector)
override;
241 template <
class dataType>
242 int run(vtkInformationVector *outputVector,
246 template <
class dataType>
248 vtkInformationVector *outputVector,
252 template <
class dataType>