VTK  9.3.1
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 
46  static vtkResliceImageViewer* New();
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 
105  vtkResliceCursor* GetResliceCursor();
106  void SetResliceCursor(vtkResliceCursor* rc);
108 
110 
113  virtual void SetLookupTable(vtkScalarsToColors*);
114  vtkScalarsToColors* GetLookupTable();
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:
188  ~vtkResliceImageViewer() override;
189 
190  void InstallPipeline() override;
191  void UnInstallPipeline() override;
192  void UpdateOrientation() override;
193  void UpdateDisplayExtent() override;
194  virtual void UpdatePointPlacer();
195 
197 
201  vtkPlane* GetReslicePlane();
202  double GetInterSliceSpacingInResliceMode();
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
vtkBoundedPlanePointPlacer * PointPlacer
vtkResliceCursorWidget * ResliceCursorWidget
Display a 2D image.
virtual void SetResliceModeToOblique()
virtual void SetColorLevel(double s)
Set window and level for mapping pixels to colors.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetInputData(vtkImageData *in)
Set/Get the input image to the viewer.
represent a reslice cursor
Proxy object to connect input/output ports.
virtual void SetColorWindow(double s)
Set window and level for mapping pixels to colors.
a placer that constrains a handle to a finite plane
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for mapping scalar values to colors.
platform-independent render window interaction including picking and frame rate control.
Manage measurements on a resliced image.
virtual void InstallPipeline()
vtkResliceImageViewerMeasurements * Measurements
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
perform various plane computations
Definition: vtkPlane.h:25
virtual void UpdateOrientation()
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set/Get the input image to the viewer.
vtkResliceImageViewerScrollCallback * ScrollCallback
virtual void UnInstallPipeline()
static vtkImageViewer2 * New()
virtual void UpdateDisplayExtent()
Update the display extent manually so that the proper slice for the given orientation is displayed...
Display an image along with a reslice cursor.
virtual void SetResliceModeToAxisAligned()
Geometry for a reslice cursor.
virtual void Render()
Render the resulting image.