Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSliceControllerWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLSliceControllerWidget_h
22 #define __qMRMLSliceControllerWidget_h
23 
24 // qMRMLWidget includes
25 #include "qMRMLViewControllerBar.h"
26 #include <vtkVersion.h>
27 
28 class QButtonGroup;
29 class QToolButton;
30 class qMRMLSliceControllerWidgetPrivate;
31 class qMRMLSliderWidget;
32 class vtkAlgorithmOutput;
33 class vtkCollection;
34 class vtkImageData;
35 class vtkMRMLNode;
36 class vtkMRMLScene;
38 class vtkMRMLSliceLogic;
39 class vtkMRMLSliceNode;
40 
54 class QMRML_WIDGETS_EXPORT qMRMLSliceControllerWidget
55  : public qMRMLViewControllerBar
56 {
57  Q_OBJECT
58  Q_PROPERTY(QString sliceViewName READ sliceViewName WRITE setSliceViewName)
59  Q_PROPERTY(QString sliceViewLabel READ sliceViewLabel WRITE setSliceViewLabel)
60  Q_PROPERTY(QColor sliceViewColor READ sliceViewColor WRITE setSliceViewColor)
61  Q_PROPERTY(double sliceOffsetResolution READ sliceOffsetResolution WRITE setSliceOffsetResolution)
62  Q_PROPERTY(bool moreButtonVisibility READ isMoreButtonVisible WRITE setMoreButtonVisible)
63  Q_PROPERTY(QString sliceOrientation READ sliceOrientation WRITE setSliceOrientation)
64 public:
67 
69  explicit qMRMLSliceControllerWidget(QWidget* parent = nullptr);
70  ~qMRMLSliceControllerWidget() override;
71 
73  bool isLinked()const;
74 
76  bool isCompareView()const;
77 
80  QString sliceOrientation()const;
81 
87  Q_INVOKABLE vtkAlgorithmOutput* imageDataConnection()const;
88 
91  Q_INVOKABLE vtkMRMLSliceNode* mrmlSliceNode()const;
92 
95  Q_INVOKABLE vtkMRMLSliceCompositeNode* mrmlSliceCompositeNode()const;
96 
100  void setSliceViewName(const QString& newSliceViewName);
101 
103  QString sliceViewName()const;
104 
109  void setSliceViewLabel(const QString& newSliceViewLabel);
110 
113  QString sliceViewLabel()const;
114 
116  void setSliceViewColor(const QColor& newSliceViewColor);
117 
119  QColor sliceViewColor()const;
120 
122  Q_INVOKABLE void setSliceOffsetRange(double min, double max);
123 
125  void setSliceOffsetResolution(double resolution);
126 
128  double sliceOffsetResolution();
129 
131  Q_INVOKABLE vtkMRMLSliceLogic* sliceLogic()const;
132 
135  Q_INVOKABLE void setSliceLogic(vtkMRMLSliceLogic * newSliceLogic);
136 
140  Q_INVOKABLE void setControllerButtonGroup(QButtonGroup* group);
141 
145  Q_INVOKABLE void setSliceLogics(vtkCollection* logics);
146 
148  Q_INVOKABLE qMRMLSliderWidget* sliceOffsetSlider();
149 
151  Q_INVOKABLE QToolButton* fitToWindowToolButton();
152 
153 public slots:
154 
155  void setMRMLScene(vtkMRMLScene* newScene) override;
156 
158  void setMRMLSliceNode(vtkMRMLSliceNode* newSliceNode);
159 
161  void setImageDataConnection(vtkAlgorithmOutput* newImageDataConnection);
162 
164  void setSliceViewSize(const QSize& newSize);
165 
168  void fitSliceToBackground();
169 
173  void setSliceOrientation(const QString& orientation);
174 
176  void setSliceOffsetValue(double offset);
177 
179  void trackSliceOffsetValue(double offset);
180 
182  void setSliceVisible(bool visible);
183 
185  void setSliceLink(bool linked);
186 
190  void setHotLinked(bool hot);
191 
192  // Advanced options
195  void setMoreButtonVisible(bool visible);
198  bool isMoreButtonVisible() const;
199 
202  void moveBackgroundComboBox(bool move);
205  void updateSegmentationControlsVisibility();
206 
208  void rotateSliceToLowestVolumeAxes();
209 
210  void setSegmentationHidden(bool hide);
211  void setLabelMapHidden(bool hide);
212  void setForegroundHidden(bool hide);
213  void setBackgroundHidden(bool hide);
214 
216  void setSegmentationOpacity(double opacity);
218  void setLabelMapOpacity(double opacity);
219  void setForegroundOpacity(double opacity);
220  void setBackgroundOpacity(double opacity);
221 
223  void toggleSegmentationOutlineFill();
225  void showLabelOutline(bool show);
227  void showReformatWidget(bool show);
228  void lockReformatWidgetToCamera(bool lock);
230  void setCompositing(int mode);
231  void setCompositingToAlphaBlend();
232  void setCompositingToReverseAlphaBlend();
233  void setCompositingToAdd();
234  void setCompositingToSubtract();
236  void setSliceSpacingMode(bool automatic);
237  void setSliceSpacing(double spacing);
238  void setSliceFOV(double fov);
239 
241  void setSliceModelMode(int mode);
242  void setSliceModelModeVolumes();
243  void setSliceModelMode2D();
244  void setSliceModelMode2D_Volumes();
245  void setSliceModelModeVolumes_2D();
246  void setSliceModelModeCustom();
247 
248  void setSliceModelFOV(int index, double fov);
249  void setSliceModelFOVX(double fov);
250  void setSliceModelFOVY(double fov);
251 
252  void setSliceModelOrigin(int index, double fov);
253  void setSliceModelOriginX(double fov);
254  void setSliceModelOriginY(double fov);
255 
256  void setSliceModelDimension(int index, int dim);
257  void setSliceModelDimensionX(int dim);
258  void setSliceModelDimensionY(int dim);
259 
260  // Orientation marker
261  void setOrientationMarkerType(int type);
262  void setOrientationMarkerSize(int size);
263 
264  // Ruler
265  void setRulerType(int type);
266  void setRulerColor(int color);
267 
268  // Lightbox
269  void setLightbox(int rows, int columns);
270  void setLightboxTo1x1();
271  void setLightboxTo1x2();
272  void setLightboxTo1x3();
273  void setLightboxTo1x4();
274  void setLightboxTo1x6();
275  void setLightboxTo1x8();
276  void setLightboxTo2x2();
277  void setLightboxTo3x3();
278  void setLightboxTo6x6();
279  // interpolation
280  void setForegroundInterpolation(bool nearestNeighbor);
281  void setBackgroundInterpolation(bool nearestNeighbor);
282 
283  void updateWidgetFromMRMLView() override;
284 
285 signals:
287  void imageDataConnectionChanged(vtkAlgorithmOutput * imageDataConnection);
288 
289  void renderRequested();
290 
292  void nodeAboutToBeEdited(vtkMRMLNode* node);
293 
294 protected:
300  qMRMLSliceControllerWidget(qMRMLSliceControllerWidgetPrivate* obj,
301  QWidget* parent);
302 
303 private:
304  Q_DECLARE_PRIVATE(qMRMLSliceControllerWidget);
305  Q_DISABLE_COPY(qMRMLSliceControllerWidget);
306 };
307 
308 #endif
MRML node for storing a slice through RAS space.
MRML node for storing a slice through RAS space.
Extend the ctkSliderWidget to integrate units support.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Slicer logic class for slice manipulation.