Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerVolumeRenderingModuleWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Brigham and Women's Hospital (BWH) All Rights Reserved.
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 Alex Yarmakovich, Isomics Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerVolumeRenderingModuleWidget_h
22 #define __qSlicerVolumeRenderingModuleWidget_h
23 
24 // CTK includes
25 #include <ctkVTKObject.h>
26 
27 // Slicer includes
29 #include "qSlicerVolumeRenderingModuleWidgetsExport.h"
30 
32 class qSlicerVolumeRenderingModuleWidgetPrivate;
35 class vtkMRMLNode;
37 class vtkMRMLViewNode;
38 class vtkMRMLVolumeNode;
41 
43 class Q_SLICER_MODULE_VOLUMERENDERING_WIDGETS_EXPORT qSlicerVolumeRenderingModuleWidget :
45 {
46  Q_OBJECT
47  QVTK_OBJECT
48 
49 public:
51  qSlicerVolumeRenderingModuleWidget(QWidget *parent=nullptr);
53 
54  Q_INVOKABLE vtkMRMLVolumeNode* mrmlVolumeNode()const;
55  Q_INVOKABLE vtkMRMLDisplayableNode* mrmlROINode()const;
56  Q_INVOKABLE vtkMRMLAnnotationROINode* mrmlAnnotationROINode()const;
57  Q_INVOKABLE vtkMRMLMarkupsROINode* mrmlMarkupsROINode()const;
58  Q_INVOKABLE vtkMRMLVolumePropertyNode* mrmlVolumePropertyNode()const;
59  Q_INVOKABLE vtkMRMLVolumeRenderingDisplayNode* mrmlDisplayNode()const;
60 
61  void addRenderingMethodWidget(const QString& methodClassName, qSlicerVolumeRenderingPropertiesWidget* widget);
62 
63  bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
64  double nodeEditable(vtkMRMLNode* node) override;
65 
66 public slots:
67  void setMRMLVolumeNode(vtkMRMLNode* node);
68  void setMRMLROINode(vtkMRMLNode* node);
69  void setMRMLVolumePropertyNode(vtkMRMLNode* node);
70 
71  void fitROIToVolume();
72 
73 protected slots:
74  void onCurrentMRMLVolumeNodeChanged(vtkMRMLNode* node);
75  void onVisibilityChanged(bool);
76  void onCropToggled(bool);
77 
78  void onCurrentMRMLROINodeChanged(vtkMRMLNode* node);
79  void onCurrentMRMLVolumePropertyNodeChanged(vtkMRMLNode* node);
80 
81  void onCurrentRenderingMethodChanged(int index);
82  void onCurrentMemorySizeChanged();
83  void onCurrentQualityControlChanged(int index);
84  void onCurrentFramerateChanged(double fps);
85  void onAutoReleaseGraphicsResourcesCheckBoxToggled(bool autoRelease);
86 
87  void updateWidgetFromMRML();
88  void updateWidgetFromROINode();
89 
90  void synchronizeScalarDisplayNode();
91  void setFollowVolumeDisplayNode(bool);
92  void setIgnoreVolumesThreshold(bool ignore);
93 
94  void onThresholdChanged(bool threshold);
95  void onROICropDisplayCheckBoxToggled(bool toggle);
96  void onChartsExtentChanged();
97  void onEffectiveRangeModified();
98 
99 protected:
100  void setup() override;
101 
102 protected:
103  QScopedPointer<qSlicerVolumeRenderingModuleWidgetPrivate> d_ptr;
104 
105 private:
106  Q_DECLARE_PRIVATE(qSlicerVolumeRenderingModuleWidget);
107  Q_DISABLE_COPY(qSlicerVolumeRenderingModuleWidget);
108 };
109 
110 #endif
MRML node to represent an ROI markup.
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
QScopedPointer< qSlicerVolumeRenderingModuleWidgetPrivate > d_ptr
MRML node for representing a volume (image stack).
MRML node to represent a 3D view.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Q_INVOKABLE double nodeEditable(vtkMRMLNode *node) override
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...