Slicer 5.9
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 : public qMRMLViewControllerBar
55{
56 Q_OBJECT
57 Q_PROPERTY(QString sliceViewName READ sliceViewName WRITE setSliceViewName)
58 Q_PROPERTY(QString sliceViewLabel READ sliceViewLabel WRITE setSliceViewLabel)
59 Q_PROPERTY(QColor sliceViewColor READ sliceViewColor WRITE setSliceViewColor)
64public:
67
69 explicit qMRMLSliceControllerWidget(QWidget* parent = nullptr);
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
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
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
149
151 Q_INVOKABLE QToolButton* fitToWindowToolButton();
152
155
156public slots:
157
158 void setMRMLScene(vtkMRMLScene* newScene) override;
159
162
164 void setImageDataConnection(vtkAlgorithmOutput* newImageDataConnection);
165
167 void setSliceViewSize(const QSize& newSize);
168
172
176 void setSliceOrientation(const QString& orientation);
177
180
182 void setSliceOffsetValue(double offset);
183
185 void trackSliceOffsetValue(double offset);
186
188 void setSliceVisible(bool visible);
189
191 void setSliceEdgeVisibility3D(bool visible);
192
194 void setSliceLink(bool linked);
195
199 void setHotLinked(bool hot);
200
201 // Advanced options
204 void setMoreButtonVisible(bool visible);
208
211 void moveBackgroundComboBox(bool move);
215
218
219 void setSegmentationHidden(bool hide);
220 void setLabelMapHidden(bool hide);
221 void setForegroundHidden(bool hide);
222 void setBackgroundHidden(bool hide);
223
225 void setSegmentationOpacity(double opacity);
227 void setLabelMapOpacity(double opacity);
228 void setForegroundOpacity(double opacity);
229 void setBackgroundOpacity(double opacity);
230
234 void showLabelOutline(bool show);
236 void showReformatWidget(bool show);
242 void setCompositing(int mode);
247 void setClipToBackground(bool enabled);
249 void setSliceSpacingMode(bool automatic);
250 void setSliceSpacing(double spacing);
251 void setSliceFOV(double fov);
252
254 void setSliceModelMode(int mode);
260
261 void setSliceModelFOV(int index, double fov);
262 void setSliceModelFOVX(double fov);
263 void setSliceModelFOVY(double fov);
264
265 void setSliceModelOrigin(int index, double fov);
266 void setSliceModelOriginX(double fov);
267 void setSliceModelOriginY(double fov);
268
269 void setSliceModelDimension(int index, int dim);
272
273 // Orientation marker
276
277 // Ruler
278 void setRulerType(int type);
279 void setRulerColor(int color);
280
281 // Slab Reconstruction
283 void setSlabReconstructionThickness(double thickness);
284
285 // Lightbox
286 void setLightbox(int rows, int columns);
296 // interpolation
297 void setForegroundInterpolation(bool nearestNeighbor);
298 void setBackgroundInterpolation(bool nearestNeighbor);
299
301
302signals:
305
307
310
311protected:
317 qMRMLSliceControllerWidget(qMRMLSliceControllerWidgetPrivate* obj, QWidget* parent);
318
319private:
320 Q_DECLARE_PRIVATE(qMRMLSliceControllerWidget);
321 Q_DISABLE_COPY(qMRMLSliceControllerWidget);
322};
323
324#endif
void lockReformatWidgetToCamera(bool lock)
Q_INVOKABLE void setControllerButtonGroup(QButtonGroup *group)
void setSliceModelFOVX(double fov)
void setSliceViewSize(const QSize &newSize)
void setBackgroundInterpolation(bool nearestNeighbor)
void setSliceOrientation(const QString &orientation)
void setLabelMapOpacity(double opacity)
Label opacity.
void setSliceViewLabel(const QString &newSliceViewLabel)
qMRMLSliceControllerWidget(QWidget *parent=nullptr)
Constructors.
Q_INVOKABLE void setSliceLogics(vtkCollection *logics)
void showReformatWidget(bool show)
Reformat widget.
Q_INVOKABLE vtkAlgorithmOutput * imageDataConnection() const
void setSliceModelDimensionX(int dim)
Q_INVOKABLE qMRMLSliderWidget * sliceOffsetSlider()
Get the slice slider widget (shown in the controller bar).
void setRulerType(int type)
void setSliceOffsetResolution(double resolution)
Set slice offset resolution (increment)
void imageDataConnectionChanged(vtkAlgorithmOutput *imageDataConnection)
This signal is emitted when the given imageData is modified.
bool isCompareView() const
Is the view a compare view.
void setSliceModelFOVY(double fov)
void setShowSliceOffsetSlider(bool show)
Set slice offset slider visibility.
void setMRMLSliceNode(vtkMRMLSliceNode *newSliceNode)
Set a new SliceNode.
void setLabelMapHidden(bool hide)
void showSlabReconstructionWidget(bool show)
Reconstruction widget.
void moveBackgroundComboBox(bool move)
void setClipToBackground(bool enabled)
void setSegmentationOpacity(double opacity)
Segmentation opacity.
void toggleSegmentationOutlineFill()
Segmentation outline/fill.
void setOrientationMarkerType(int type)
Q_INVOKABLE vtkMRMLSliceLogic * sliceLogic() const
Get SliceLogic.
void rotateSliceToLowestVolumeAxes()
Rotate to volume plane (first of background, foreground, or label)
void setMoreButtonVisible(bool visible)
void setSliceSpacing(double spacing)
void setHotLinked(bool hot)
void setBackgroundHidden(bool hide)
void setForegroundOpacity(double opacity)
void setImageDataConnection(vtkAlgorithmOutput *newImageDataConnection)
Set a new imageData.
void updateSegmentationControlsVisibility()
void setForegroundInterpolation(bool nearestNeighbor)
void setSliceModelOriginY(double fov)
void setSliceModelOrigin(int index, double fov)
void setSliceModelMode(int mode)
Slice Model.
void setSliceSpacingMode(bool automatic)
Slice spacing.
void setSlabReconstructionThickness(double thickness)
void showLabelOutline(bool show)
Label outline.
void setForegroundHidden(bool hide)
void setSliceModelDimension(int index, int dim)
void trackSliceOffsetValue(double offset)
Set slice offset. Used when events will come is rapid succession.
void setOrientationMarkerSize(int size)
void setBackgroundOpacity(double opacity)
Q_INVOKABLE void setSliceOffsetRange(double min, double max)
Set slice offset range.
void setSliceModelFOV(int index, double fov)
void setSliceEdgeVisibility3D(bool visible)
Set slice edge visible.
Q_INVOKABLE QToolButton * fitToWindowToolButton()
Get the fit to window button (shown in the controller bar).
void setCompositing(int mode)
Compositing.
void setMRMLScene(vtkMRMLScene *newScene) override
void updateWidgetFromMRMLView() override
void setSliceOffsetValue(double offset)
Set slice offset. Used to set a single value.
void toggleSlabReconstructionInteractive(bool interactive)
qMRMLViewControllerBar Superclass
Superclass typedef.
void setSliceVisible(bool visible)
Set slice visible.
void setSliceViewColor(const QColor &newSliceViewColor)
Set the color for the slice view.
Q_INVOKABLE void setSliceLogic(vtkMRMLSliceLogic *newSliceLogic)
Q_INVOKABLE vtkMRMLSliceCompositeNode * mrmlSliceCompositeNode() const
void nodeAboutToBeEdited(vtkMRMLNode *node)
Signal emitted when editing of a node is requested from within the controller.
void setSlabReconstructionType(int type)
void setSliceModelOriginX(double fov)
Q_INVOKABLE vtkMRMLSliceNode * mrmlSliceNode() const
bool isLinked() const
Are the slices linked to each other.
void setSliceLink(bool linked)
Link/Unlink the slice controls across all slice viewer.
void setSegmentationHidden(bool hide)
bool isMoreButtonVisible() const
void setSliceFOV(double fov)
void setLightbox(int rows, int columns)
void setSliceViewName(const QString &newSliceViewName)
void setRulerColor(int color)
void setSliceModelDimensionY(int dim)
Extend the ctkSliderWidget to integrate units support.
qMRMLViewControllerBar(QWidget *parent=nullptr)
Constructors.
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.