forked from alankzh/MNavigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myslicerwidget.h
81 lines (53 loc) · 1.59 KB
/
myslicerwidget.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
#ifndef MYSLICERWIDGET_H
#define MYSLICERWIDGET_H
#include "qts.h"
#include <QWidget>
#include "vtkSmartPointer.h"
#include "vtkDICOMImageReader.h"
#include "QVTKWidget.h"
#include "vtkImageViewer2.h"
#include "vtkEventQtSlotConnect.h"
#include "vtkVector.h"
#include "vtkObject.h"
#include "vtkActor.h"
#include "vtkTextActor.h"
class mySlicerWidget : public QVTKWidget
{
Q_OBJECT
public:
mySlicerWidget(QWidget *parent=0);
enum ORIENTATION{
defalut=0,
XY=1,
YZ=2,
XZ=3
};
void loadSlicerData(vtkImageData *data,mySlicerWidget::ORIENTATION o);
ORIENTATION GetOrientation() const;
void setLocation(int x,int y,int width,int height);
void setSlicerValue(int shiftValue);
void setSlicerValueByRatio(double ratio);
void updateRender();
int getSlicerMax();
int getSlicerMin();
int getSlicer();
vtkSmartPointer<vtkImageViewer2> getImageViewer2();
protected:
void setOrientation(ORIENTATION o);
private:
//截面窗口,封装了自己的vtk管线
vtkSmartPointer<vtkImageViewer2> imageViewer2;
vtkSmartPointer<vtkTextActor> direction_info;
vtkSmartPointer<vtkTextActor> depth_info;
vtkSmartPointer<vtkEventQtSlotConnect> vtkConnections;
void ListenMarkClick();
void DrawMarker(vtkVector3d ModelPosition, vtkActor* marker);
bool hasSlicerSourceData=false;
signals:
void OnMarkClick(vtkVector3d ModelPosition);
public slots:
void MarkReact(vtkVector3d ModelPosition);
void Mark(vtkObject* obj, unsigned long, void*, void*);
void onSliderValueChanged(int value);
};
#endif // MYSLICERWIDGET_H