Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSegmentationFileExportWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Andras Lasso, PerkLab, Queen's University
18  and was supported through CANARIE's Research Software Program, and Cancer
19  Care Ontario.
20 
21 ==============================================================================*/
22 
23 #ifndef __qMRMLSegmentationFileExportWidget_h
24 #define __qMRMLSegmentationFileExportWidget_h
25 
26 // MRMLWidgets includes
27 #include "qMRMLWidget.h"
28 
29 #include "qSlicerSegmentationsModuleWidgetsExport.h"
30 
31 // CTK includes
32 #include <ctkPimpl.h>
33 #include <ctkVTKObject.h>
34 
35 class qMRMLSegmentationFileExportWidgetPrivate;
36 
37 class vtkMRMLNode;
40 class QItemSelection;
41 
45 class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_EXPORT qMRMLSegmentationFileExportWidget : public qMRMLWidget
46 {
47  Q_OBJECT
48  QVTK_OBJECT
49 
53  Q_PROPERTY(QString settingsKey READ settingsKey WRITE setSettingsKey)
54 
55 public:
57  explicit qMRMLSegmentationFileExportWidget(QWidget* parent = nullptr);
60 
61  QString settingsKey()const;
62  void setSettingsKey(const QString& key);
63 
65  Q_INVOKABLE vtkMRMLSegmentationNode* segmentationNode() const;
67  Q_INVOKABLE QString segmentationNodeID();
68 
69 signals:
71  void exportToFilesDone();
72 
73 public slots:
74  void setMRMLScene(vtkMRMLScene* mrmlScene) override;
75 
77  void setSegmentationNode(vtkMRMLSegmentationNode* node);
78  void setSegmentationNode(vtkMRMLNode* node);
79 
80  void exportToFiles();
81 
82  void showDestinationFolder();
83 
84  void updateWidgetFromSettings();
85  void updateSettingsFromWidget();
86 
87  void updateWidgetFromMRML();
88 
89  void onSegmentationReferenceImageGeometryChanged();
90 
91 protected slots:
92 
93  void setFileFormat(const QString&);
94  void setColorNodeID(const QString&);
95  void setUseLabelsFromColorNode(bool useColorNode);
96 
97 protected:
98  QScopedPointer<qMRMLSegmentationFileExportWidgetPrivate> d_ptr;
99 
100 private:
101  Q_DECLARE_PRIVATE(qMRMLSegmentationFileExportWidget);
102  Q_DISABLE_COPY(qMRMLSegmentationFileExportWidget);
103 };
104 
105 #endif
Qt widget for selecting a single segment from a segmentation. If multiple segments are needed...
QScopedPointer< qMRMLSegmentationFileExportWidgetPrivate > d_ptr
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
MRML node for representing segmentation display attributes.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
virtual void setMRMLScene(vtkMRMLScene *newScene)
Set the MRML scene associated with the widget.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...