Slicer 5.6
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
36class vtkMRMLNode;
38class qMRMLSegmentationGeometryWidgetPrivate;
39
40class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_EXPORT qMRMLSegmentationGeometryWidget : public qMRMLWidget
41{
42 Q_OBJECT
43 QVTK_OBJECT
44
45 Q_PROPERTY(bool editEnabled READ editEnabled WRITE setEditEnabled)
46 Q_PROPERTY(double oversamplingFactor READ oversamplingFactor WRITE setOversamplingFactor)
47 Q_PROPERTY(bool isotropicSpacing READ isotropicSpacing WRITE setIsotropicSpacing)
48 Q_PROPERTY(bool padSegmentation READ padSegmentation WRITE setPadSegmentation)
49
50public:
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 bool padSegmentation()const;
66
67 void setSpacing(double aSpacing[3]);
68
70 Q_INVOKABLE void geometryImageData(vtkOrientedImageData* outputGeometry);
71
72public slots:
74 void setSegmentationNode(vtkMRMLSegmentationNode* node);
75
76 void setEditEnabled(bool aEditEnabled);
77 void setSourceNode(vtkMRMLNode* sourceNode);
78 void setOversamplingFactor(double aOversamplingFactor);
79 void setIsotropicSpacing(bool aIsotropicSpacing);
80 void setPadSegmentation(bool aPadSegmentation);
81
83 void setReferenceImageGeometryForSegmentationNode();
84
86 void resampleLabelmapsInSegmentationNode();
87
88protected slots:
90 void updateWidgetFromMRML();
91
93 void onSourceNodeChanged(vtkMRMLNode*);
94
95 void onOversamplingFactorChanged(double);
96 void onIsotropicSpacingChanged(bool);
97 void onUserSpacingChanged(double*);
98 void onPadSegmentationChanged(bool);
99
100protected:
101 QScopedPointer<qMRMLSegmentationGeometryWidgetPrivate> d_ptr;
102
103private:
104 Q_DECLARE_PRIVATE(qMRMLSegmentationGeometryWidget);
105 Q_DISABLE_COPY(qMRMLSegmentationGeometryWidget);
106};
107
108#endif
Base class for any widget that requires a MRML Scene.
Definition qMRMLWidget.h:36
Abstract Superclass for all specific types of MRML nodes.
MRML node containing segmentations.
Image data containing orientation information.