-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkNewImageConvolution.h
executable file
·91 lines (76 loc) · 2.88 KB
/
vtkNewImageConvolution.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
91
#ifndef __vtkNewImageConvolution_h
#define __vtkNewImageConvolution_h
#include "vtkSimpleImageToImageFilter.h"
#include "vtkImageData.h"
#include "vtkPoints.h"
#include "vtkFloatArray.h"
class vtkNewImageConvolution : public vtkSimpleImageToImageFilter
{
public:
static vtkNewImageConvolution *New();
vtkTypeMacro(vtkNewImageConvolution,vtkSimpleImageToImageFilter);
// Description:
// DistanceMap -- distance from traced structure
vtkSetObjectMacro(FilterBank,vtkImageData);
vtkGetObjectMacro(FilterBank,vtkImageData);
// Description:
// Mode
vtkGetMacro(Mode,int);
vtkSetClampMacro(Mode,int,0,2);
virtual void SetModeToConvolve() { this->SetMode(0); }
virtual void SetModeToDeviation() { this->SetMode(1); }
virtual void SetModeToBoth() { this->SetMode(2); }
// Description:
// Second Output is Mean Image in case when Mode = 2
vtkGetObjectMacro(SecondOutput,vtkImageData);
// Description:
// Precision
vtkSetClampMacro(DoublePrecision,int,0,1);
vtkGetMacro(DoublePrecision,int);
// Description:
// Use CPU/GPU
vtkSetClampMacro(ForceCPU,int,0,1);
vtkGetMacro(ForceCPU,int);
// Description:
// Use Complex to Complex mappings
vtkSetClampMacro(DoComplexFFTs,int,0,1);
vtkGetMacro(DoComplexFFTs,int);
// Description:
// Output timings
vtkSetClampMacro(TimingMode,int,0,1);
vtkGetMacro(TimingMode,int);
// XQ's version:
static vtkImageData* qVesselFilter(double anglespacing,int radius,double sigma_r=3.0,double sigma=2.0);
protected:
vtkNewImageConvolution();
virtual ~vtkNewImageConvolution();
vtkNewImageConvolution(const vtkNewImageConvolution&) {};
void operator=(const vtkNewImageConvolution&) {};
// Description:
// Basic Input Outputs
// ----------------------------------------------------------------------------
virtual int RequestInformation(vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
virtual void SimpleExecute(vtkImageData* inp,vtkImageData* out);
// Description:
// Data
// ----------------------------------------------------------------------------
vtkImageData* FilterBank;
vtkImageData* SecondOutput;
int Mode;
int DoublePrecision;
int ForceCPU;
int DoComplexFFTs;
int TimingMode;
// Description:
// Normalize 'new' sphere filters.
virtual void normalizeFilters(vtkImageData* FILTERS);
// Description:
// Basic Operations for Convolutions in Fourier Space
// ----------------------------------------------------------------------------
virtual vtkImageData* PadImage(vtkImageData* img,int paddim[3]);
virtual vtkImageData* FFTImage(vtkImageData* img,int frame,int paddim[3],int dosquare, vtkDataArray* data=NULL);
virtual vtkImageData* DoFourierConvolution(vtkImageData* img1,vtkImageData* img2,int origdim[3],double origori[3], int DoSquare);
};
#endif