TTK
Loading...
Searching...
No Matches
ttkTrackingFromOverlap.h
Go to the documentation of this file.
1
41
42#pragma once
43
44// VTK includes
45#include <vtkInformation.h>
46#include <vtkMultiBlockDataSet.h>
47#include <vtkSmartPointer.h>
48#include <vtkUnstructuredGridAlgorithm.h>
49
50// VTK Module
51#include <ttkTrackingFromOverlapModule.h>
52
53// TTK includes
54#include <TrackingFromOverlap.h>
55#include <ttkAlgorithm.h>
56
57class TTKTRACKINGFROMOVERLAP_EXPORT ttkTrackingFromOverlap
58 : public ttkAlgorithm,
59 protected ttk::TrackingFromOverlap {
60
61public:
64
65 vtkSetMacro(LabelFieldName, const std::string &);
66 vtkGetMacro(LabelFieldName, std::string);
67
68protected:
70 SetNumberOfInputPorts(1);
71 SetNumberOfOutputPorts(1);
72 }
73
74 int reset();
75
76 int packInputData(vtkDataObject *inputDataObject,
77 vtkMultiBlockDataSet *packedData) const;
78 int packStreamedData(vtkMultiBlockDataSet *streamedData,
79 vtkMultiBlockDataSet *packedData) const;
80 int checkData(vtkMultiBlockDataSet *data);
81
82 int storeStreamedData(vtkMultiBlockDataSet *data);
83 int computeNodes(vtkMultiBlockDataSet *data);
84 int computeTrackingGraphs(vtkMultiBlockDataSet *data);
85 int computeNestingTrees(vtkMultiBlockDataSet *data);
86 int computeBranches();
87
88 int meshNestedTrackingGraph(vtkDataObject *trackingGraph);
89
90 int RequestData(vtkInformation *request,
91 vtkInformationVector **inputVector,
92 vtkInformationVector *outputVector) override;
93
94 int FillInputPortInformation(int port, vtkInformation *info) override {
95 switch(port) {
96 case 0:
97 info->Remove(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE());
98 info->Append(
99 vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkMultiBlockDataSet");
100 info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
101 break;
102 default:
103 return 0;
104 }
105 return 1;
106 }
107
108 int FillOutputPortInformation(int port, vtkInformation *info) override {
109 switch(port) {
110 case 0:
111 info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkUnstructuredGrid");
112 break;
113 default:
114 return 0;
115 }
116 return 1;
117 }
118
119private:
120 int LabelDataType;
121 std::string LabelFieldName{"RegionId"};
122
123 vtkSmartPointer<vtkMultiBlockDataSet> previousIterationData;
124
125 // Containers for nodes and edges
126 std::vector<std::vector<Nodes>> levelTimeNodesMap; // N
127 std::vector<std::vector<Edges>> levelTimeEdgesTMap; // E_T
128 std::vector<std::vector<Edges>> timeLevelEdgesNMap; // E_N
129};
Baseclass of all VTK filters that wrap ttk modules.
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
TTK VTK-filter that computes the overlap between labeled vtkPointSets.
int FillInputPortInformation(int port, vtkInformation *info) override
int FillOutputPortInformation(int port, vtkInformation *info) override
static ttkTrackingFromOverlap * New()
TTK trackingFromOverlap processing package that tracks labeled point sets.
int computeNodes(const float *pointCoordinates, const labelType *pointLabels, const size_t nPoints, Nodes &nodes) const
int computeBranches(std::vector< Edges > &timeEdgesMap, std::vector< Nodes > &timeNodesMap) const