-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMyImageViewer2.h
132 lines (100 loc) · 3.56 KB
/
MyImageViewer2.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef MYIMAGEVIEWER2_H
#define MYIMAGEVIEWER2_H
#include <vtkImageViewer2.h>
#include <vtkObjectFactory.h>
#include <vtkRenderer.h>
#include <vtkImageActor.h>
#include <vtkImageMapToWindowLevelColors.h>
#include <vtkImageData.h>
#include <vtkTextActor.h>
#include <vtkCursor3D.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkProperty.h>
#include <vtkLookupTable.h>
#include <qstring.h>
class MyImageViewer2: public vtkImageViewer2
{
public:
static MyImageViewer2* New();
vtkTypeMacro(MyImageViewer2, vtkImageViewer2);
void PrintSelf(ostream& os, vtkIndent indent);
// Text methods
virtual void InitializeHeader(QString File);
virtual void InitializeIntensityText(QString IntText);
virtual void InitializeOrientationText();
void ResizeOrientationText();
// Cursor methods
virtual void SetCursorBoundary();
virtual void SetBound(double* b);
virtual void SetFocalPoint(double x, double y, double z);
virtual double* GetBound();
virtual double* GetFocalPoint();
// Description:
// Render the resulting image.
virtual void Render(void);
// Description:
// Set/Get the input image to the viewer.
// the AnnotationImage will be set as the input
virtual void SetInputData(vtkImageData* in);
//virtual vtkImageData* GetInput();
// Description:
// Get the AnnotationImage
virtual void SetAnnotationImage(vtkImageData* in);
virtual vtkImageData* GetAnnotationImage();
virtual vtkLookupTable* GetLookupTable();
virtual void SetLookupTable(vtkLookupTable* lookupTable);
//// Replace the old AnnotationImage
//virtual void ResetAnnotationImage(vtkImageData* AnnotationImage);
// Description:
// Update the display extent manually so that the proper slice for the
// given orientation is displayed. It will also try to set a
// reasonable camera clipping range.
// This method is called automatically when the Input is changed, but
// most of the time the input of this class is likely to remain the same,
// i.e. connected to the output of a filter, or an image reader. When the
// input of this filter or reader itself is changed, an error message might
// be displayed since the current display extent is probably outside
// the new whole extent. Calling this method will ensure that the display
// extent is reset properly.
virtual void UpdateDisplayExtent();
// Description:
// Get the internal annotation renderer, annotation actor, and
// annotation image map instances.
vtkGetObjectMacro(AnnotationRenderer, vtkRenderer);
vtkGetObjectMacro(AnnotationActor, vtkImageActor);
vtkGetObjectMacro(AnnotationWindowLevel, vtkImageMapToWindowLevelColors);
// Description:
// Set your own Annotation Renderer
virtual void SetAnnotationRenderer(vtkRenderer *arg);
// Description:
// Attach an interactor for the internal render window.
virtual void SetupInteractor(vtkRenderWindowInteractor* arg);
protected:
MyImageViewer2();
~MyImageViewer2();
virtual void InstallPipeline();
virtual void UnInstallPipeline();
// Annotation Things
vtkImageMapToWindowLevelColors* AnnotationWindowLevel;
vtkRenderer* AnnotationRenderer;
vtkImageActor* AnnotationActor;
// use an internal AnnotationImage pointer for doing paint brush
//vtkImageData* AnnotationImage;
//OrientationText
vtkTextActor* OrientationTextActor[4];
//Header
vtkTextActor* HeaderActor;
// IntensityText
vtkTextActor* IntTextActor;
//Cursor
vtkCursor3D* Cursor3D;
vtkPolyDataMapper* CursorMapper;
vtkActor* CursorActor;
//BackGround
double Bound[6];
private:
MyImageViewer2(const MyImageViewer2&);
void operator=(const MyImageViewer2&);
};
#endif // !MYIMAGEVIEWER2_H