-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvolumeRendering.h
73 lines (70 loc) · 2.43 KB
/
volumeRendering.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
/*
* =====================================================================================
*
* Filename: volumeRendering.h
*
* Description: Class responsible for data reading (DICOM files), and volume rendering on gpu with smart mapper.
*
* Version: 1.0
* Created: 09/29/2011 13:28:57
* Revision: none
* Compiler: llvm/clang++
*
* Author: YOUR NAME (Louis Dijkstra Alex Theiakos),
* Company:
*
* =====================================================================================
*/
#include <vtkDICOMImageReader.h>
#include <vtkImageData.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkSmartVolumeMapper.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkSmartPointer.h>
#include <vtkAlgorithm.h>
#include <vtkVolume.h>
#include <vtkVolumeProperty.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <QVTKWidget.h>
#include <QObject>
#include <string>
#include <iostream>
using std::string ;
/*
* =====================================================================================
* Class: VolumeRendering
* Description: This class reads the DICOM file and volume renderes the data. Constructor needs a directory name.
* =====================================================================================
*/
class VolumeRendering : public QObject {
Q_OBJECT ;
public:
VolumeRendering(string dirname) ;
~VolumeRendering() ;
inline QVTKWidget* getRenderWindow(){ return qvtkWidget ; }
void setupReader() ;
void setupDefaultTransferFunctions (int minValue, int maxValue) ;
void setupRenderer() ;
void setupTransferFunctions() ;
void setupVolume() ;
public slots:
//TODO functions to change color and opacity functions depending on the UI sliders.
void startRendering() ;
void setOpacityFunction(int startPoint, float startValue, int endPoint, float endValue) ;
void clearAllPoints() ;
private:
string dirname ;
vtkDICOMImageReader *DICOMreader ;
vtkRenderer *renderer ;
vtkRenderWindow *renderWindow ;
QVTKWidget *qvtkWidget ;
vtkSmartVolumeMapper *mapper ;
vtkVolume *volume ;
vtkVolumeProperty *property ;
vtkColorTransferFunction *colorFun ;
vtkPiecewiseFunction *opacityFun ;
vtkAlgorithm *reader ;
vtkImageData *input ;
};