VTK  9.3.20240228
vtkResliceImageViewer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
24 #ifndef vtkResliceImageViewer_h
25 #define vtkResliceImageViewer_h
26 
27 #include "vtkImageViewer2.h"
28 #include "vtkInteractionImageModule.h" // For export macro
29 
30 VTK_ABI_NAMESPACE_BEGIN
32 class vtkResliceCursor;
33 class vtkScalarsToColors;
36 class vtkResliceImageViewerScrollCallback;
37 class vtkPlane;
38 
39 class VTKINTERACTIONIMAGE_EXPORT vtkResliceImageViewer : public vtkImageViewer2
40 {
41 public:
43 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  void Render() override;
55 
57 
60  void SetInputData(vtkImageData* in) override;
61  void SetInputConnection(vtkAlgorithmOutput* input) override;
63 
65 
68  void SetColorWindow(double s) override;
69  void SetColorLevel(double s) override;
71 
73 
77  vtkGetObjectMacro(ResliceCursorWidget, vtkResliceCursorWidget);
79 
84  enum
85  {
86  RESLICE_AXIS_ALIGNED = 0,
87  RESLICE_OBLIQUE = 1
88  };
89 
90  vtkGetMacro(ResliceMode, int);
91  virtual void SetResliceMode(int resliceMode);
93  {
94  this->SetResliceMode(vtkResliceImageViewer::RESLICE_AXIS_ALIGNED);
95  }
96  virtual void SetResliceModeToOblique()
97  {
98  this->SetResliceMode(vtkResliceImageViewer::RESLICE_OBLIQUE);
99  }
100 
102 
108 
110 
116 
118 
121  virtual void SetThickMode(int);
122  virtual int GetThickMode();
124 
128  virtual void Reset();
129 
131 
134  vtkGetObjectMacro(PointPlacer, vtkBoundedPlanePointPlacer);
136 
138 
141  vtkGetObjectMacro(Measurements, vtkResliceImageViewerMeasurements);
143 
145 
148  vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
150 
152 
158  vtkSetMacro(SliceScrollOnMouseWheel, vtkTypeBool);
159  vtkGetMacro(SliceScrollOnMouseWheel, vtkTypeBool);
160  vtkBooleanMacro(SliceScrollOnMouseWheel, vtkTypeBool);
162 
164 
172  vtkSetMacro(SliceScrollFactor, double);
173  vtkGetMacro(SliceScrollFactor, double);
175 
179  virtual void IncrementSlice(int inc);
180 
181  enum
182  {
183  SliceChangedEvent = 1001
184  };
185 
186 protected:
189 
190  void InstallPipeline() override;
191  void UnInstallPipeline() override;
192  void UpdateOrientation() override;
193  void UpdateDisplayExtent() override;
194  virtual void UpdatePointPlacer();
195 
197 
204 
210  vtkResliceImageViewerScrollCallback* ScrollCallback;
211  double SliceScrollFactor = 1.0;
212 
213 private:
215  void operator=(const vtkResliceImageViewer&) = delete;
216 };
217 
218 VTK_ABI_NAMESPACE_END
219 #endif
Proxy object to connect input/output ports.
a placer that constrains a handle to a finite plane
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
Display a 2D image.
a simple class to control print indentation
Definition: vtkIndent.h:108
perform various plane computations
Definition: vtkPlane.h:135
platform-independent render window interaction including picking and frame rate control.
represent a reslice cursor
Geometry for a reslice cursor.
Manage measurements on a resliced image.
Display an image along with a reslice cursor.
void UpdateOrientation() override
void SetColorWindow(double s) override
Set window and level for mapping pixels to colors.
vtkResliceCursorWidget * ResliceCursorWidget
void SetInputData(vtkImageData *in) override
Set/Get the input image to the viewer.
virtual void SetResliceModeToAxisAligned()
virtual int GetThickMode()
Switch to / from thick mode.
static vtkResliceImageViewer * New()
Standard VTK methods.
virtual void SetResliceModeToOblique()
void Render() override
Render the resulting image.
void SetColorLevel(double s) override
Set window and level for mapping pixels to colors.
vtkResliceImageViewerScrollCallback * ScrollCallback
vtkPlane * GetReslicePlane()
Convenience methods to get the reslice plane and the normalized spacing between slices in reslice mod...
vtkBoundedPlanePointPlacer * PointPlacer
~vtkResliceImageViewer() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
double GetInterSliceSpacingInResliceMode()
Convenience methods to get the reslice plane and the normalized spacing between slices in reslice mod...
virtual void Reset()
Reset all views back to initial state.
void SetResliceCursor(vtkResliceCursor *rc)
Set/Get the reslice cursor.
void UpdateDisplayExtent() override
Update the display extent manually so that the proper slice for the given orientation is displayed.
virtual void IncrementSlice(int inc)
Increment/Decrement slice by 'inc' slices.
vtkResliceCursor * GetResliceCursor()
Set/Get the reslice cursor.
virtual void SetLookupTable(vtkScalarsToColors *)
Set the lookup table.
void UnInstallPipeline() override
void SetInputConnection(vtkAlgorithmOutput *input) override
Set/Get the input image to the viewer.
virtual void UpdatePointPlacer()
vtkScalarsToColors * GetLookupTable()
Set the lookup table.
vtkResliceImageViewerMeasurements * Measurements
void InstallPipeline() override
virtual void SetThickMode(int)
Switch to / from thick mode.
virtual void SetResliceMode(int resliceMode)
Superclass for mapping scalar values to colors.
int vtkTypeBool
Definition: vtkABI.h:64