Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
26#include <vtkVersion.h>
27
28class QButtonGroup;
29class QToolButton;
30class qMRMLSliceControllerWidgetPrivate;
32class vtkAlgorithmOutput;
33class vtkCollection;
34class vtkImageData;
35class vtkMRMLNode;
36class vtkMRMLScene;
40
54class QMRML_WIDGETS_EXPORT qMRMLSliceControllerWidget
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 Q_PROPERTY(bool showSliceOffsetSlider READ showSliceOffsetSlider WRITE setShowSliceOffsetSlider)
65public:
68
70 explicit qMRMLSliceControllerWidget(QWidget* parent = nullptr);
72
74 bool isLinked()const;
75
77 bool isCompareView()const;
78
81 QString sliceOrientation()const;
82
88 Q_INVOKABLE vtkAlgorithmOutput* imageDataConnection()const;
89
92 Q_INVOKABLE vtkMRMLSliceNode* mrmlSliceNode()const;
93
96 Q_INVOKABLE vtkMRMLSliceCompositeNode* mrmlSliceCompositeNode()const;
97
101 void setSliceViewName(const QString& newSliceViewName);
102
104 QString sliceViewName()const;
105
110 void setSliceViewLabel(const QString& newSliceViewLabel);
111
114 QString sliceViewLabel()const;
115
117 void setSliceViewColor(const QColor& newSliceViewColor);
118
120 QColor sliceViewColor()const;
121
123 Q_INVOKABLE void setSliceOffsetRange(double min, double max);
124
126 void setSliceOffsetResolution(double resolution);
127
129 double sliceOffsetResolution();
130
132 Q_INVOKABLE vtkMRMLSliceLogic* sliceLogic()const;
133
136 Q_INVOKABLE void setSliceLogic(vtkMRMLSliceLogic * newSliceLogic);
137
141 Q_INVOKABLE void setControllerButtonGroup(QButtonGroup* group);
142
146 Q_INVOKABLE void setSliceLogics(vtkCollection* logics);
147
149 Q_INVOKABLE qMRMLSliderWidget* sliceOffsetSlider();
150
152 Q_INVOKABLE QToolButton* fitToWindowToolButton();
153
155 bool showSliceOffsetSlider()const;
156
157public slots:
158
159 void setMRMLScene(vtkMRMLScene* newScene) override;
160
162 void setMRMLSliceNode(vtkMRMLSliceNode* newSliceNode);
163
165 void setImageDataConnection(vtkAlgorithmOutput* newImageDataConnection);
166
168 void setSliceViewSize(const QSize& newSize);
169
172 void fitSliceToBackground();
173
177 void setSliceOrientation(const QString& orientation);
178
180 void setShowSliceOffsetSlider(bool show);
181
183 void setSliceOffsetValue(double offset);
184
186 void trackSliceOffsetValue(double offset);
187
189 void setSliceVisible(bool visible);
190
192 void setSliceLink(bool linked);
193
197 void setHotLinked(bool hot);
198
199 // Advanced options
202 void setMoreButtonVisible(bool visible);
205 bool isMoreButtonVisible() const;
206
209 void moveBackgroundComboBox(bool move);
212 void updateSegmentationControlsVisibility();
213
215 void rotateSliceToLowestVolumeAxes();
216
217 void setSegmentationHidden(bool hide);
218 void setLabelMapHidden(bool hide);
219 void setForegroundHidden(bool hide);
220 void setBackgroundHidden(bool hide);
221
223 void setSegmentationOpacity(double opacity);
225 void setLabelMapOpacity(double opacity);
226 void setForegroundOpacity(double opacity);
227 void setBackgroundOpacity(double opacity);
228
230 void toggleSegmentationOutlineFill();
232 void showLabelOutline(bool show);
234 void showReformatWidget(bool show);
235 void lockReformatWidgetToCamera(bool lock);
237 void showSlabReconstructionWidget(bool show);
239 void setCompositing(int mode);
240 void setCompositingToAlphaBlend();
241 void setCompositingToReverseAlphaBlend();
242 void setCompositingToAdd();
243 void setCompositingToSubtract();
245 void setSliceSpacingMode(bool automatic);
246 void setSliceSpacing(double spacing);
247 void setSliceFOV(double fov);
248
250 void setSliceModelMode(int mode);
251 void setSliceModelModeVolumes();
252 void setSliceModelMode2D();
253 void setSliceModelMode2D_Volumes();
254 void setSliceModelModeVolumes_2D();
255 void setSliceModelModeCustom();
256
257 void setSliceModelFOV(int index, double fov);
258 void setSliceModelFOVX(double fov);
259 void setSliceModelFOVY(double fov);
260
261 void setSliceModelOrigin(int index, double fov);
262 void setSliceModelOriginX(double fov);
263 void setSliceModelOriginY(double fov);
264
265 void setSliceModelDimension(int index, int dim);
266 void setSliceModelDimensionX(int dim);
267 void setSliceModelDimensionY(int dim);
268
269 // Orientation marker
270 void setOrientationMarkerType(int type);
271 void setOrientationMarkerSize(int size);
272
273 // Ruler
274 void setRulerType(int type);
275 void setRulerColor(int color);
276
277 // Slab Reconstruction
278 void setSlabReconstructionType(int type);
279 void setSlabReconstructionThickness(double thickness);
280
281 // Lightbox
282 void setLightbox(int rows, int columns);
283 void setLightboxTo1x1();
284 void setLightboxTo1x2();
285 void setLightboxTo1x3();
286 void setLightboxTo1x4();
287 void setLightboxTo1x6();
288 void setLightboxTo1x8();
289 void setLightboxTo2x2();
290 void setLightboxTo3x3();
291 void setLightboxTo6x6();
292 // interpolation
293 void setForegroundInterpolation(bool nearestNeighbor);
294 void setBackgroundInterpolation(bool nearestNeighbor);
295
296 void updateWidgetFromMRMLView() override;
297
298signals:
300 void imageDataConnectionChanged(vtkAlgorithmOutput * imageDataConnection);
301
302 void renderRequested();
303
305 void nodeAboutToBeEdited(vtkMRMLNode* node);
306
307protected:
313 qMRMLSliceControllerWidget(qMRMLSliceControllerWidgetPrivate* obj,
314 QWidget* parent);
315
316private:
317 Q_DECLARE_PRIVATE(qMRMLSliceControllerWidget);
318 Q_DISABLE_COPY(qMRMLSliceControllerWidget);
319};
320
321#endif
Extend the ctkSliderWidget to integrate units support.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing a slice through RAS space.
Slicer logic class for slice manipulation.
MRML node for storing a slice through RAS space.