Slicer  5.1
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 
172  void setSliceOrientation(const QString& orientation);
173 
175  void setSliceOffsetValue(double offset);
176 
178  void trackSliceOffsetValue(double offset);
179 
181  void setSliceVisible(bool visible);
182 
184  void setSliceLink(bool linked);
185 
189  void setHotLinked(bool hot);
190 
191  // Advanced options
194  void setMoreButtonVisible(bool visible);
197  bool isMoreButtonVisible() const;
198 
201  void moveBackgroundComboBox(bool move);
204  void updateSegmentationControlsVisibility();
205 
207  void rotateSliceToLowestVolumeAxes();
208 
209  void setSegmentationHidden(bool hide);
210  void setLabelMapHidden(bool hide);
211  void setForegroundHidden(bool hide);
212  void setBackgroundHidden(bool hide);
213 
215  void setSegmentationOpacity(double opacity);
217  void setLabelMapOpacity(double opacity);
218  void setForegroundOpacity(double opacity);
219  void setBackgroundOpacity(double opacity);
220 
222  void toggleSegmentationOutlineFill();
224  void showLabelOutline(bool show);
226  void showReformatWidget(bool show);
227  void lockReformatWidgetToCamera(bool lock);
229  void setCompositing(int mode);
230  void setCompositingToAlphaBlend();
231  void setCompositingToReverseAlphaBlend();
232  void setCompositingToAdd();
233  void setCompositingToSubtract();
235  void setSliceSpacingMode(bool automatic);
236  void setSliceSpacing(double spacing);
237  void setSliceFOV(double fov);
238 
240  void setSliceModelMode(int mode);
241  void setSliceModelModeVolumes();
242  void setSliceModelMode2D();
243  void setSliceModelMode2D_Volumes();
244  void setSliceModelModeVolumes_2D();
245  void setSliceModelModeCustom();
246 
247  void setSliceModelFOV(int index, double fov);
248  void setSliceModelFOVX(double fov);
249  void setSliceModelFOVY(double fov);
250 
251  void setSliceModelOrigin(int index, double fov);
252  void setSliceModelOriginX(double fov);
253  void setSliceModelOriginY(double fov);
254 
255  void setSliceModelDimension(int index, int dim);
256  void setSliceModelDimensionX(int dim);
257  void setSliceModelDimensionY(int dim);
258 
259  // Orientation marker
260  void setOrientationMarkerType(int type);
261  void setOrientationMarkerSize(int size);
262 
263  // Ruler
264  void setRulerType(int type);
265  void setRulerColor(int color);
266 
267  // Lightbox
268  void setLightbox(int rows, int columns);
269  void setLightboxTo1x1();
270  void setLightboxTo1x2();
271  void setLightboxTo1x3();
272  void setLightboxTo1x4();
273  void setLightboxTo1x6();
274  void setLightboxTo1x8();
275  void setLightboxTo2x2();
276  void setLightboxTo3x3();
277  void setLightboxTo6x6();
278  // interpolation
279  void setForegroundInterpolation(bool nearestNeighbor);
280  void setBackgroundInterpolation(bool nearestNeighbor);
281 
282  void updateWidgetFromMRMLView() override;
283 
284 signals:
286  void imageDataConnectionChanged(vtkAlgorithmOutput * imageDataConnection);
287 
288  void renderRequested();
289 
291  void nodeAboutToBeEdited(vtkMRMLNode* node);
292 
293 protected:
299  qMRMLSliceControllerWidget(qMRMLSliceControllerWidgetPrivate* obj,
300  QWidget* parent);
301 
302 private:
303  Q_DECLARE_PRIVATE(qMRMLSliceControllerWidget);
304  Q_DISABLE_COPY(qMRMLSliceControllerWidget);
305 };
306 
307 #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.