-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsurfacereconstruction.h
79 lines (65 loc) · 2.27 KB
/
surfacereconstruction.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
/**
* @file surfacereconstruction.h
*
* @brief Simple surface reconstruction algorithm for a series of DICOM images
* using vtk + gdcm libraries
*
* This class is intended to read a directory that contains a series of 2D DICOM
* images that form a volume and to perform a simple surface reconstruction
* algorithm. The input image is smoothed and thresholded. After that, morphological
* operators are applied in order to remove small structures and, finally, surfaces
* are computed using the marching cubes algorithm.
* Moreover, this class encapsulates the code needed to display the computed surface
* in a vtkRenderWindow widget.
*
* @author Noelia Barreira ([email protected])
*/
#ifndef SURFACERECONSTRUCTION_H
#define SURFACERECONSTRUCTION_H
#include <vtkSmartPointer.h>
#include <vtkMarchingCubes.h>
#include <vtkRenderWindow.h>
#include <string>
#include <vtkImageChangeInformation.h>
class SurfaceReconstruction
{
public:
SurfaceReconstruction();
~SurfaceReconstruction();
/**
* @brief ReadDICOMSeries Opens a directory where the dicom series is stored
* and loads the files into a single vtk volume image
* @param dir Directory where the DICOM files are stored
* @return Number of dicom files read
*/
int ReadDICOMSeries(std::string dir);
/**
* @brief Update Applies the surface reconstruction algorithm. If no image was
* previously loaded, it does nothing.
*/
void Update();
/**
* @brief Show Displays the computed surface in a render window. If no surface
* was previously computed, it does nothing.
* @param renderWindow a pointer to a vtkRenderWindow
*/
void Show(vtkSmartPointer<vtkRenderWindow> renderWindow);
// Getters and setters: surface reconstruction algorithm parameters
double getThreshold() const;
void setThreshold(double value);
double getGaussianSize() const;
void setGaussianSize(double value);
double getGaussianStd() const;
void setGaussianStd(double value);
double getMorphologicalSize() const;
void setMorphologicalSize(double value);
private:
double thresholdValue;
double gaussianSize;
double gaussianStd;
double morphologicalSize;
int computed;
vtkSmartPointer<vtkMarchingCubes> surface;
vtkSmartPointer<vtkImageChangeInformation> input;
};
#endif // SURFACERECONSTRUCTION_H