-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvtkCriticalLinesExtractor.h
90 lines (60 loc) · 2.19 KB
/
vtkCriticalLinesExtractor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#include <vtkImageData.h>
#include <vtkVector.h>
#include <vtkPolyDataAlgorithm.h>
#include "variational/StoppingCriteria.h"
#include "variational/Gradient.h"
#include "variational/DoubleBufferedLine.h"
class vtkCriticalLinesExtractor : public vtkPolyDataAlgorithm
{
public:
static vtkCriticalLinesExtractor* New();
vtkTypeMacro(vtkCriticalLinesExtractor, vtkPolyDataAlgorithm)
void SetImageData(vtkSmartPointer<vtkImageData> imageData);
vtkGetMacro(GrowingIterations, int)
vtkSetMacro(GrowingIterations, int)
vtkGetMacro(TimeStep, double)
vtkSetMacro(TimeStep, double)
vtkGetMacro(VariationalIterations, int)
vtkSetMacro(VariationalIterations, int)
vtkGetMacro(AdamLearningRate, double)
vtkSetMacro(AdamLearningRate, double)
vtkGetMacro(UseComputeBoundingBox, bool)
vtkSetMacro(UseComputeBoundingBox, bool)
vtkGetMacro(BBMin, vtkVector3d)
vtkSetMacro(BBMin, vtkVector3d)
vtkGetMacro(BBMax, vtkVector3d)
vtkSetMacro(BBMax, vtkVector3d)
vtkGetStringMacro(FieldNameV)
vtkSetStringMacro(FieldNameV)
vtkGetStringMacro(FieldNameVx)
vtkSetStringMacro(FieldNameVx)
vtkGetStringMacro(FieldNameVy)
vtkSetStringMacro(FieldNameVy)
vtkGetStringMacro(FieldNameVt)
vtkSetStringMacro(FieldNameVt)
protected:
vtkCriticalLinesExtractor();
~vtkCriticalLinesExtractor() override = default;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
int GrowingIterations;
double TimeStep;
int VariationalIterations;
double AdamLearningRate;
bool UseComputeBoundingBox;
vtkVector3d BBMin;
vtkVector3d BBMax;
char* FieldNameV;
char* FieldNameVx;
char* FieldNameVy;
char* FieldNameVt;
vtkSmartPointer<vtkImageData> ImageData;
private:
vtkCriticalLinesExtractor(const vtkCriticalLinesExtractor&); // Not implemented.
void operator=(const vtkCriticalLinesExtractor&); // Not implemented.
std::deque<Eigen::Vector3d> extract(const Eigen::Vector3d& seed) const;
void grow(DoubleBufferedLine3& line, const bool& forward = true) const;
Eigen::Vector3d SampleImageData(Eigen::Vector3d coords, const char* arrayName) const;
Eigen::Vector3d Sample(const Eigen::Vector3d& coordinate, const char* arrayName) const;
double stepSize;
};