Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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)
49
50public:
53 explicit qMRMLSegmentationGeometryWidget(QWidget* parent = nullptr);
56
59 Q_INVOKABLE QString segmentationNodeID()const;
60
61 bool editEnabled()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:
75
76 void setEditEnabled(bool aEditEnabled);
78 void setOversamplingFactor(double aOversamplingFactor);
79 void setIsotropicSpacing(bool aIsotropicSpacing);
80 void setPadSegmentation(bool aPadSegmentation);
81
84
87
88protected slots:
91
94
97 void onUserSpacingChanged(double*);
99
100protected:
101 QScopedPointer<qMRMLSegmentationGeometryWidgetPrivate> d_ptr;
102
103private:
104 Q_DECLARE_PRIVATE(qMRMLSegmentationGeometryWidget);
105 Q_DISABLE_COPY(qMRMLSegmentationGeometryWidget);
106};
107
108#endif
void onSourceNodeChanged(vtkMRMLNode *)
Calculate source axis permutation and then output geometry.
void setReferenceImageGeometryForSegmentationNode()
Set reference geometry conversion parameter to the one specified.
void updateWidgetFromMRML()
Calculate output geometry from input segmentation and source node and update UI.
void onOversamplingFactorChanged(double)
Q_INVOKABLE vtkMRMLSegmentationNode * segmentationNode() const
Get segmentation MRML node.
Q_INVOKABLE QString segmentationNodeID() const
Q_INVOKABLE void geometryImageData(vtkOrientedImageData *outputGeometry)
Get calculated geometry image data.
void setSegmentationNode(vtkMRMLSegmentationNode *node)
Set segmentation MRML node.
void resampleLabelmapsInSegmentationNode()
Resample existing labelmaps in segmentation node with specified geometry.
void setIsotropicSpacing(bool aIsotropicSpacing)
void setSpacing(double aSpacing[3])
void setEditEnabled(bool aEditEnabled)
void setSourceNode(vtkMRMLNode *sourceNode)
void setPadSegmentation(bool aPadSegmentation)
void setOversamplingFactor(double aOversamplingFactor)
vtkMRMLNode * sourceNode() const
QScopedPointer< qMRMLSegmentationGeometryWidgetPrivate > d_ptr
qMRMLSegmentationGeometryWidget(QWidget *parent=nullptr)
Constructor.
qMRMLWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Abstract Superclass for all specific types of MRML nodes.
MRML node containing segmentations.
Image data containing orientation information.