Slicer  4.8
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 qMRMLSliceControllerWidgetPrivate;
30 class vtkAlgorithmOutput;
31 class vtkCollection;
32 class vtkImageData;
33 class vtkMRMLNode;
34 class vtkMRMLScene;
36 class vtkMRMLSliceLogic;
37 class vtkMRMLSliceNode;
38 
52 class QMRML_WIDGETS_EXPORT qMRMLSliceControllerWidget
53  : public qMRMLViewControllerBar
54 {
55  Q_OBJECT
56  Q_PROPERTY(QString sliceViewName READ sliceViewName WRITE setSliceViewName)
57  Q_PROPERTY(QString sliceViewLabel READ sliceViewLabel WRITE setSliceViewLabel)
58  Q_PROPERTY(bool moreButtonVisibility READ isMoreButtonVisible WRITE setMoreButtonVisible)
59 public:
62 
64  explicit qMRMLSliceControllerWidget(QWidget* parent = 0);
65  virtual ~qMRMLSliceControllerWidget();
66 
68  bool isLinked()const;
69 
71  bool isCompareView()const;
72 
75  QString sliceOrientation()const;
76 
82  vtkAlgorithmOutput* imageDataConnection()const;
83 
86  vtkMRMLSliceNode* mrmlSliceNode()const;
87 
90  vtkMRMLSliceCompositeNode* mrmlSliceCompositeNode()const;
91 
95  void setSliceViewName(const QString& newSliceViewName);
96 
98  QString sliceViewName()const;
99 
101  Q_INVOKABLE static QColor sliceViewColor(const QString& sliceViewName);
102 
107  void setSliceViewLabel(const QString& newSliceViewLabel);
108 
111  QString sliceViewLabel()const;
112 
114  void setSliceViewColor(const QColor& newSliceViewColor);
115 
117  QColor sliceViewColor()const;
118 
120  void setSliceOffsetRange(double min, double max);
121 
123  void setSliceOffsetResolution(double resolution);
124 
126  vtkMRMLSliceLogic* sliceLogic()const;
127 
130  void setSliceLogic(vtkMRMLSliceLogic * newSliceLogic);
131 
135  void setControllerButtonGroup(QButtonGroup* group);
136 
140  void setSliceLogics(vtkCollection* logics);
141 
142 public slots:
143 
144  virtual void setMRMLScene(vtkMRMLScene* newScene);
145 
147  void setMRMLSliceNode(vtkMRMLSliceNode* newSliceNode);
148 
150  void setImageDataConnection(vtkAlgorithmOutput* newImageDataConnection);
151 
153  void setSliceViewSize(const QSize& newSize);
154 
157  void fitSliceToBackground();
158 
161  void setSliceOrientation(const QString& orientation);
162 
164  void setSliceOffsetValue(double offset);
165 
167  void trackSliceOffsetValue(double offset);
168 
170  void setSliceVisible(bool visible);
171 
173  void setSliceLink(bool linked);
174 
178  void setHotLinked(bool hot);
179 
180  // Advanced options
183  void setMoreButtonVisible(bool visible);
186  bool isMoreButtonVisible() const;
187 
190  void moveBackgroundComboBox(bool move);
193  void updateSegmentationControlsVisibility();
194 
196  void rotateSliceToBackground();
197 
198  void setSegmentationHidden(bool hide);
199  void setLabelMapHidden(bool hide);
200  void setForegroundHidden(bool hide);
201  void setBackgroundHidden(bool hide);
202 
204  void setSegmentationOpacity(double opacity);
206  void setLabelMapOpacity(double opacity);
207  void setForegroundOpacity(double opacity);
208  void setBackgroundOpacity(double opacity);
209 
211  void toggleSegmentationOutlineFill();
213  void showLabelOutline(bool show);
215  void showReformatWidget(bool show);
216  void lockReformatWidgetToCamera(bool lock);
218  void setCompositing(int mode);
219  void setCompositingToAlphaBlend();
220  void setCompositingToReverseAlphaBlend();
221  void setCompositingToAdd();
222  void setCompositingToSubtract();
224  void setSliceSpacingMode(bool automatic);
225  void setSliceSpacing(double spacing);
226  void setSliceFOV(double fov);
227 
229  void setSliceModelMode(int mode);
230  void setSliceModelModeVolumes();
231  void setSliceModelMode2D();
232  void setSliceModelMode2D_Volumes();
233  void setSliceModelModeVolumes_2D();
234  void setSliceModelModeCustom();
235 
236  void setSliceModelFOV(int index, double fov);
237  void setSliceModelFOVX(double fov);
238  void setSliceModelFOVY(double fov);
239 
240  void setSliceModelOrigin(int index, double fov);
241  void setSliceModelOriginX(double fov);
242  void setSliceModelOriginY(double fov);
243 
244  void setSliceModelDimension(int index, int dim);
245  void setSliceModelDimensionX(int dim);
246  void setSliceModelDimensionY(int dim);
247 
248  // Orientation marker
249  void setOrientationMarkerType(int type);
250  void setOrientationMarkerSize(int size);
251 
252  // Ruler
253  void setRulerType(int type);
254 
255  // Lightbox
256  void setLightbox(int rows, int columns);
257  void setLightboxTo1x1();
258  void setLightboxTo1x2();
259  void setLightboxTo1x3();
260  void setLightboxTo1x4();
261  void setLightboxTo1x6();
262  void setLightboxTo1x8();
263  void setLightboxTo2x2();
264  void setLightboxTo3x3();
265  void setLightboxTo6x6();
266  // interpolation
267  void setForegroundInterpolation(bool nearestNeighbor);
268  void setBackgroundInterpolation(bool nearestNeighbor);
269 
270 signals:
272  void imageDataConnectionChanged(vtkAlgorithmOutput * imageDataConnection);
273 
274  void renderRequested();
275 
277  void nodeAboutToBeEdited(vtkMRMLNode* node);
278 
279 protected:
285  qMRMLSliceControllerWidget(qMRMLSliceControllerWidgetPrivate* obj,
286  QWidget* parent);
287 
288 private:
289  Q_DECLARE_PRIVATE(qMRMLSliceControllerWidget);
290  Q_DISABLE_COPY(qMRMLSliceControllerWidget);
291 };
292 
293 #endif
MRML node for storing a slice through RAS space.
MRML node for storing a slice through RAS space.
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:135
Slicer logic class for slice manipulation.