Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMorphologicalOperationsWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkMorphologicalOperationsWidget_h
14 #define QmitkMorphologicalOperationsWidget_h
15 
17 
19 #include <mitkRenderingManager.h>
20 
22 
23 #include <QWidget>
24 #include <memory>
25 
26 namespace Ui
27 {
28  class QmitkMorphologicalOperationsWidgetControls;
29 }
30 
31 namespace mitk
32 {
33  class DataNode;
34  class DataStorage;
35 }
36 
47 {
48  Q_OBJECT
49 
50 public:
56  explicit QmitkMorphologicalOperationsWidget(mitk::DataStorage* dataStorage, QWidget* parent = nullptr);
59 
60 public slots:
75 
76 protected:
78 
79  using MorphFunctionType = void(mitk::Image::Pointer& image, int factor,
81  void Processing(std::function<MorphFunctionType> morphFunction, const std::string& opsName) const;
82 
83 private:
84  mitk::Image::Pointer GetSelectedLabelMask() const;
92  void SaveResultLabelMask(
93  const mitk::Image* resultMask, const std::string& labelName, const std::string& provenanceOpName) const;
94 
95  mitk::MorphologicalOperations::StructuralElementType CreateStructerElement_UI() const;
96 
97  std::unique_ptr<Ui::QmitkMorphologicalOperationsWidgetControls> m_Controls;
98 };
99 
100 #endif
#define MITKSEGMENTATIONUI_EXPORT
QList< mitk::DataNode::Pointer > NodeList
Widget providing morphological operations on segmentation labels.
void OnDilatationButtonClicked()
Performs morphological dilation on the selected label.
void OnClosingButtonClicked()
Performs morphological closing on the selected label.
void OnFillHolesButtonClicked()
Fills holes in the selected label.
void OnErosionButtonClicked()
Performs morphological erosion on the selected label.
void OnSelectionChanged(QmitkAbstractNodeSelectionWidget::NodeList nodes)
Called when the segmentation selection changes.
void(mitk::Image::Pointer &image, int factor, mitk::MorphologicalOperations::StructuralElementType structuralElement) MorphFunctionType
~QmitkMorphologicalOperationsWidget() override
Destructor.
void OnOpeningButtonClicked()
Performs morphological opening on the selected label.
QmitkMorphologicalOperationsWidget(mitk::DataStorage *dataStorage, QWidget *parent=nullptr)
Constructs the widget with GUI elements and signal/slot connections.
void Processing(std::function< MorphFunctionType > morphFunction, const std::string &opsName) const
void OnRadioButtonsClicked()
Called when the structural element radio buttons are clicked.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
StructuralElementType
Defines the type and orientation of the structuring element.
Find image slices visible on a given plane.