forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkResliceImageViewer.h
203 lines (171 loc) · 5.27 KB
/
vtkResliceImageViewer.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*=========================================================================
Program: Visualization Toolkit
Module: vtkResliceImageViewer.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkResliceImageViewer
* @brief Display an image along with a reslice cursor
*
* This class is similar to vtkImageViewer2. It displays the image along with
* a two cross hairs for reslicing. The cross hairs may be interactively
* manipulated and are typically used to reslice two other views of
* vtkResliceImageViewer. See QtVTKRenderWindows for an example. The reslice
* cursor is used to perform thin or thick MPR through data. The class can
* also default to the behaviour of vtkImageViewer2 if the Reslice mode is
* set to RESLICE_AXIS_ALIGNED.
* @sa
* vtkResliceCursor vtkResliceCursorWidget vtkResliceCursorRepresentation
*/
#ifndef vtkResliceImageViewer_h
#define vtkResliceImageViewer_h
#include "vtkInteractionImageModule.h" // For export macro
#include "vtkImageViewer2.h"
class vtkResliceCursorWidget;
class vtkResliceCursor;
class vtkScalarsToColors;
class vtkBoundedPlanePointPlacer;
class vtkResliceImageViewerMeasurements;
class vtkResliceImageViewerScrollCallback;
class vtkPlane;
class VTKINTERACTIONIMAGE_EXPORT vtkResliceImageViewer : public vtkImageViewer2
{
public:
//@{
/**
* Standard VTK methods.
*/
static vtkResliceImageViewer *New();
vtkTypeMacro(vtkResliceImageViewer,vtkImageViewer2);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
//@}
/**
* Render the resulting image.
*/
void Render() VTK_OVERRIDE;
//@{
/**
* Set/Get the input image to the viewer.
*/
void SetInputData(vtkImageData *in) VTK_OVERRIDE;
void SetInputConnection(vtkAlgorithmOutput* input) VTK_OVERRIDE;
//@}
//@{
/**
* Set window and level for mapping pixels to colors.
*/
void SetColorWindow(double s) VTK_OVERRIDE;
void SetColorLevel(double s) VTK_OVERRIDE;
//@}
//@{
/**
* Get the internal render window, renderer, image actor, and
* image map instances.
*/
vtkGetObjectMacro(ResliceCursorWidget,vtkResliceCursorWidget);
//@}
/**
* Set/get the slice orientation
*/
enum
{
RESLICE_AXIS_ALIGNED = 0,
RESLICE_OBLIQUE = 1
};
vtkGetMacro(ResliceMode, int);
virtual void SetResliceMode(int resliceMode);
virtual void SetResliceModeToAxisAligned()
{ this->SetResliceMode(vtkResliceImageViewer::RESLICE_AXIS_ALIGNED); };
virtual void SetResliceModeToOblique()
{ this->SetResliceMode(vtkResliceImageViewer::RESLICE_OBLIQUE); };
//@{
/**
* Set/Get the reslice cursor.
*/
vtkResliceCursor * GetResliceCursor();
void SetResliceCursor( vtkResliceCursor * rc );
//@}
//@{
/**
* Set the lookup table
*/
virtual void SetLookupTable( vtkScalarsToColors * );
vtkScalarsToColors * GetLookupTable();
//@}
//@{
/**
* Switch to / from thick mode
*/
virtual void SetThickMode( int );
virtual int GetThickMode();
//@}
/**
* Reset all views back to initial state
*/
virtual void Reset();
//@{
/**
* Get the point placer.
*/
vtkGetObjectMacro( PointPlacer, vtkBoundedPlanePointPlacer );
//@}
//@{
/**
* Get the measurements manager
*/
vtkGetObjectMacro( Measurements, vtkResliceImageViewerMeasurements );
//@}
//@{
/**
* Get the render window interactor
*/
vtkGetObjectMacro( Interactor, vtkRenderWindowInteractor );
//@}
//@{
/**
* Scroll slices on the mouse wheel ? In the case of MPR
* view, it moves one "normalized spacing" in the direction of the normal to
* the resliced plane, provided the new center will continue to lie within
* the volume.
*/
vtkSetMacro( SliceScrollOnMouseWheel, int );
vtkGetMacro( SliceScrollOnMouseWheel, int );
vtkBooleanMacro( SliceScrollOnMouseWheel, int );
//@}
/**
* Increment/Decrement slice by 'n' slices
*/
virtual void IncrementSlice( int n );
enum { SliceChangedEvent = 1001 };
protected:
vtkResliceImageViewer();
~vtkResliceImageViewer() VTK_OVERRIDE;
void InstallPipeline() VTK_OVERRIDE;
void UnInstallPipeline() VTK_OVERRIDE;
void UpdateOrientation() VTK_OVERRIDE;
void UpdateDisplayExtent() VTK_OVERRIDE;
virtual void UpdatePointPlacer();
//@{
/**
* Convenience methods to get the reslice plane and the normalized
* spacing between slices in reslice mode.
*/
vtkPlane * GetReslicePlane();
double GetInterSliceSpacingInResliceMode();
//@}
vtkResliceCursorWidget * ResliceCursorWidget;
vtkBoundedPlanePointPlacer * PointPlacer;
int ResliceMode;
vtkResliceImageViewerMeasurements * Measurements;
int SliceScrollOnMouseWheel;
vtkResliceImageViewerScrollCallback * ScrollCallback;
private:
vtkResliceImageViewer(const vtkResliceImageViewer&) VTK_DELETE_FUNCTION;
void operator=(const vtkResliceImageViewer&) VTK_DELETE_FUNCTION;
};
#endif