Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSegmentationGeometryWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
16  and was supported through the Applied Cancer Research Unit program of Cancer Care
17  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18  and CANARIE.
19 
20 ==============================================================================*/
21 
22 #ifndef __qMRMLSegmentationGeometryWidget_h
23 #define __qMRMLSegmentationGeometryWidget_h
24 
25 // Segmentations includes
26 #include "qSlicerSegmentationsModuleWidgetsExport.h"
27 
28 // MRMLWidgets includes
29 #include "qMRMLWidget.h"
30 
31 // CTK includes
32 #include <ctkPimpl.h>
33 #include <ctkVTKObject.h>
34 
36 class vtkMRMLNode;
38 class qMRMLSegmentationGeometryWidgetPrivate;
39 
41 class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_EXPORT qMRMLSegmentationGeometryWidget : public qMRMLWidget
42 {
43  Q_OBJECT
44  QVTK_OBJECT
45 
46  Q_PROPERTY(bool editEnabled READ editEnabled WRITE setEditEnabled)
47  Q_PROPERTY(double oversamplingFactor READ oversamplingFactor WRITE setOversamplingFactor)
48  Q_PROPERTY(bool isotropicSpacing READ isotropicSpacing WRITE setIsotropicSpacing)
49  Q_PROPERTY(bool padSegmentation READ padSegmentation WRITE setPadSegmentation)
50 
51 public:
54  explicit qMRMLSegmentationGeometryWidget(QWidget* parent = nullptr);
57 
59  Q_INVOKABLE vtkMRMLSegmentationNode* segmentationNode()const;
60  Q_INVOKABLE QString segmentationNodeID()const;
61 
62  bool editEnabled()const;
63  vtkMRMLNode* sourceNode()const;
64  double oversamplingFactor()const;
65  bool isotropicSpacing()const;
66  bool padSegmentation()const;
67 
68  void setSpacing(double aSpacing[3]);
69 
71  Q_INVOKABLE void geometryImageData(vtkOrientedImageData* outputGeometry);
72 
73 public slots:
75  void setSegmentationNode(vtkMRMLSegmentationNode* node);
76 
77  void setEditEnabled(bool aEditEnabled);
78  void setSourceNode(vtkMRMLNode* sourceNode);
79  void setOversamplingFactor(double aOversamplingFactor);
80  void setIsotropicSpacing(bool aIsotropicSpacing);
81  void setPadSegmentation(bool aPadSegmentation);
82 
84  void setReferenceImageGeometryForSegmentationNode();
85 
87  void resampleLabelmapsInSegmentationNode();
88 
89 protected slots:
91  void updateWidgetFromMRML();
92 
94  void onSourceNodeChanged(vtkMRMLNode*);
95 
96  void onOversamplingFactorChanged(double);
97  void onIsotropicSpacingChanged(bool);
98  void onUserSpacingChanged(double*);
99  void onPadSegmentationChanged(bool);
100 
101 protected:
102  QScopedPointer<qMRMLSegmentationGeometryWidgetPrivate> d_ptr;
103 
104 private:
105  Q_DECLARE_PRIVATE(qMRMLSegmentationGeometryWidget);
106  Q_DISABLE_COPY(qMRMLSegmentationGeometryWidget);
107 };
108 
109 #endif
Image data containing orientation information.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
QWidget Superclass
Definition: qMRMLWidget.h:40
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 ...