Slicer  5.2
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  void onNewVolumePropertyAdded(vtkMRMLNode* node);
81 
82  void onCurrentRenderingMethodChanged(int index);
83  void onCurrentMemorySizeChanged();
84  void onCurrentQualityControlChanged(int index);
85  void onCurrentFramerateChanged(double fps);
86  void onAutoReleaseGraphicsResourcesCheckBoxToggled(bool autoRelease);
87 
88  void updateWidgetFromMRML();
89  void updateWidgetFromROINode();
90 
91  void synchronizeScalarDisplayNode();
92  void setFollowVolumeDisplayNode(bool);
93  void setIgnoreVolumesThreshold(bool ignore);
94 
95  void onThresholdChanged(bool threshold);
96  void onROICropDisplayCheckBoxToggled(bool toggle);
97  void onChartsExtentChanged();
98  void onEffectiveRangeModified();
99 
100 protected:
101  void setup() override;
102 
103 protected:
104  QScopedPointer<qSlicerVolumeRenderingModuleWidgetPrivate> d_ptr;
105 
106 private:
107  Q_DECLARE_PRIVATE(qSlicerVolumeRenderingModuleWidget);
108  Q_DISABLE_COPY(qSlicerVolumeRenderingModuleWidget);
109 };
110 
111 #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...