Slicer  4.10
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 = 0);
70  virtual ~qMRMLSliceControllerWidget();
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 
106  Q_INVOKABLE static QColor sliceViewColor(const QString& sliceViewName);
107 
112  void setSliceViewLabel(const QString& newSliceViewLabel);
113 
116  QString sliceViewLabel()const;
117 
119  void setSliceViewColor(const QColor& newSliceViewColor);
120 
122  QColor sliceViewColor()const;
123 
125  Q_INVOKABLE void setSliceOffsetRange(double min, double max);
126 
128  void setSliceOffsetResolution(double resolution);
129 
131  double sliceOffsetResolution();
132 
134  Q_INVOKABLE vtkMRMLSliceLogic* sliceLogic()const;
135 
138  Q_INVOKABLE void setSliceLogic(vtkMRMLSliceLogic * newSliceLogic);
139 
143  Q_INVOKABLE void setControllerButtonGroup(QButtonGroup* group);
144 
148  Q_INVOKABLE void setSliceLogics(vtkCollection* logics);
149 
151  Q_INVOKABLE qMRMLSliderWidget* sliceOffsetSlider();
152 
154  Q_INVOKABLE QToolButton* fitToWindowToolButton();
155 
156 public slots:
157 
158  virtual void setMRMLScene(vtkMRMLScene* newScene);
159 
161  void setMRMLSliceNode(vtkMRMLSliceNode* newSliceNode);
162 
164  void setImageDataConnection(vtkAlgorithmOutput* newImageDataConnection);
165 
167  void setSliceViewSize(const QSize& newSize);
168 
171  void fitSliceToBackground();
172 
175  void setSliceOrientation(const QString& orientation);
176 
178  void setSliceOffsetValue(double offset);
179 
181  void trackSliceOffsetValue(double offset);
182 
184  void setSliceVisible(bool visible);
185 
187  void setSliceLink(bool linked);
188 
192  void setHotLinked(bool hot);
193 
194  // Advanced options
197  void setMoreButtonVisible(bool visible);
200  bool isMoreButtonVisible() const;
201 
204  void moveBackgroundComboBox(bool move);
207  void updateSegmentationControlsVisibility();
208 
210  void rotateSliceToBackground();
211 
212  void setSegmentationHidden(bool hide);
213  void setLabelMapHidden(bool hide);
214  void setForegroundHidden(bool hide);
215  void setBackgroundHidden(bool hide);
216 
218  void setSegmentationOpacity(double opacity);
220  void setLabelMapOpacity(double opacity);
221  void setForegroundOpacity(double opacity);
222  void setBackgroundOpacity(double opacity);
223 
225  void toggleSegmentationOutlineFill();
227  void showLabelOutline(bool show);
229  void showReformatWidget(bool show);
230  void lockReformatWidgetToCamera(bool lock);
232  void setCompositing(int mode);
233  void setCompositingToAlphaBlend();
234  void setCompositingToReverseAlphaBlend();
235  void setCompositingToAdd();
236  void setCompositingToSubtract();
238  void setSliceSpacingMode(bool automatic);
239  void setSliceSpacing(double spacing);
240  void setSliceFOV(double fov);
241 
243  void setSliceModelMode(int mode);
244  void setSliceModelModeVolumes();
245  void setSliceModelMode2D();
246  void setSliceModelMode2D_Volumes();
247  void setSliceModelModeVolumes_2D();
248  void setSliceModelModeCustom();
249 
250  void setSliceModelFOV(int index, double fov);
251  void setSliceModelFOVX(double fov);
252  void setSliceModelFOVY(double fov);
253 
254  void setSliceModelOrigin(int index, double fov);
255  void setSliceModelOriginX(double fov);
256  void setSliceModelOriginY(double fov);
257 
258  void setSliceModelDimension(int index, int dim);
259  void setSliceModelDimensionX(int dim);
260  void setSliceModelDimensionY(int dim);
261 
262  // Orientation marker
263  void setOrientationMarkerType(int type);
264  void setOrientationMarkerSize(int size);
265 
266  // Ruler
267  void setRulerType(int type);
268 
269  // Lightbox
270  void setLightbox(int rows, int columns);
271  void setLightboxTo1x1();
272  void setLightboxTo1x2();
273  void setLightboxTo1x3();
274  void setLightboxTo1x4();
275  void setLightboxTo1x6();
276  void setLightboxTo1x8();
277  void setLightboxTo2x2();
278  void setLightboxTo3x3();
279  void setLightboxTo6x6();
280  // interpolation
281  void setForegroundInterpolation(bool nearestNeighbor);
282  void setBackgroundInterpolation(bool nearestNeighbor);
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:54
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
Slicer logic class for slice manipulation.