Slicer  4.11
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 
50 public:
53  explicit qMRMLSegmentationGeometryWidget(QWidget* parent = nullptr);
56 
58  Q_INVOKABLE vtkMRMLSegmentationNode* segmentationNode()const;
59  Q_INVOKABLE QString segmentationNodeID()const;
60 
61  bool editEnabled()const;
62  vtkMRMLNode* sourceNode()const;
63  double oversamplingFactor()const;
64  bool isotropicSpacing()const;
65 
66  void setSpacing(double aSpacing[3]);
67 
69  Q_INVOKABLE void geometryImageData(vtkOrientedImageData* outputGeometry);
70 
71 public slots:
73  void setSegmentationNode(vtkMRMLSegmentationNode* node);
74 
75  void setEditEnabled(bool aEditEnabled);
76  void setSourceNode(vtkMRMLNode* sourceNode);
77  void setOversamplingFactor(double aOversamplingFactor);
78  void setIsotropicSpacing(bool aIsotropicSpacing);
79 
81  void setReferenceImageGeometryForSegmentationNode();
82 
84  void resampleLabelmapsInSegmentationNode();
85 
86 protected slots:
88  void updateWidgetFromMRML();
89 
91  void onSourceNodeChanged(vtkMRMLNode*);
92 
93  void onOversamplingFactorChanged(double);
94  void onIsotropicSpacingChanged(bool);
95  void onUserSpacingChanged(double*);
96 
97 protected:
98  QScopedPointer<qMRMLSegmentationGeometryWidgetPrivate> d_ptr;
99 
100 private:
101  Q_DECLARE_PRIVATE(qMRMLSegmentationGeometryWidget);
102  Q_DISABLE_COPY(qMRMLSegmentationGeometryWidget);
103 };
104 
105 #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 ...