Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkLabelSetWidget.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 QmitkLabelSetWidget_h
14 #define QmitkLabelSetWidget_h
15 
17 
19 #include "mitkLabel.h"
20 #include "mitkNumericTypes.h"
21 #include <ui_QmitkLabelSetWidgetControls.h>
22 
24 class QCompleter;
25 
26 namespace mitk
27 {
28  class LabelSetImage;
29  class LabelSet;
30  class Label;
31  class DataStorage;
32  class ToolManager;
33  class DataNode;
34 }
35 
37 {
38  Q_OBJECT
39 
40 public:
41  explicit QmitkLabelSetWidget(QWidget *parent = nullptr);
42  ~QmitkLabelSetWidget() override;
43 
44  void SetDataStorage(mitk::DataStorage *storage);
45 
46  void SetOrganColors(const QStringList &organColors);
47 
48  void UpdateControls();
49 
50  virtual void setEnabled(bool enabled);
51 
52  QStringList &GetLabelStringList();
53 
54 signals:
55 
57  void goToLabel(const mitk::Point3D &);
58  void resetView();
59 
60 public slots:
61 
69  void UpdateAllTableWidgetItems();
77  void ResetAllTableWidgetItems();
78  void SelectLabelByPixelValue(mitk::Label::PixelType pixelValue);
79 
80 private slots:
81 
82  // LabelSet dependent
83  void OnOpacityChanged(int);
84  void OnUnlockAllLabels(bool);
85  void OnLockAllLabels(bool);
86  void OnSetAllLabelsVisible(bool);
87  void OnSetAllLabelsInvisible(bool);
88  void OnSetOnlyActiveLabelVisible(bool);
89  void OnRandomColor(bool);
90  void OnRemoveLabel(bool);
91  void OnRemoveLabels(bool);
92  void OnRenameLabel(bool);
93  void OnLockedButtonClicked();
94  void OnVisibleButtonClicked();
95  void OnColorButtonClicked();
96  void OnItemClicked(QTableWidgetItem *item);
97  void OnItemDoubleClicked(QTableWidgetItem *item);
98  void OnTableViewContextMenuRequested(const QPoint &);
99  void InsertTableWidgetItem(mitk::Label *label);
100  void UpdateTableWidgetItem(QTableWidgetItem *item);
101  // reaction to "returnPressed" signal from ...
102  void OnSearchLabel();
103  // reaction to the button "Change Label"
104  void OnActiveLabelChanged(int pixelValue);
105 
106  // LabelSetImage Dependet
107  void OnCreateDetailedSurface(bool);
108  void OnCreateSmoothedSurface(bool);
109  // reaction to the signal "createMask" from QmitkLabelSetTableWidget
110  void OnCreateMask(bool);
111  void OnCreateMasks(bool);
112  // reaction to the signal "createCroppedMask" from QmitkLabelSetTableWidget
113  void OnCreateCroppedMask(bool);
114  void OnCombineAndCreateMask(bool);
115  void OnCombineAndCreateSurface(bool);
116  void OnEraseLabel(bool);
117  void OnEraseLabels(bool);
118  // reaction to signal "mergeLabel" from QmitkLabelSetTableWidget
119  void OnMergeLabel(bool);
120  void OnMergeLabels(bool);
121  // reaction to the button "Import Segmentation"
122  void OnImportSegmentation();
123  // reaction to the button "Import Labeled Image"
124  void OnImportLabeledImage();
125 
126  // reaction to signal "labelListModified" from QmitkLabelSetTableWidget
127  void OnLabelListModified(const QStringList &list);
128  // reaction to the signal "toggleOutline" from QmitkLabelSetTableWidget
129  void OnToggleOutline(bool);
130 
131 private:
132  enum TableColumns
133  {
134  NAME_COL = 0,
135  LOCKED_COL,
136  COLOR_COL,
137  VISIBLE_COL
138  };
139 
140  void WaitCursorOn();
141 
142  void WaitCursorOff();
143 
144  void RestoreOverrideCursor();
145 
146  void OnThreadedCalculationDone();
147 
148  void InitializeTableWidget();
149 
150  int GetPixelValueOfSelectedItem();
151 
152  mitk::LabelSetImage *GetWorkingImage();
153 
154  mitk::DataNode *GetWorkingNode();
155 
156  Ui::QmitkLabelSetWidgetControls m_Controls;
157 
158  mitk::ColorSequenceRainbow m_ColorSequenceRainbow;
159 
161 
162  QCompleter *m_Completer;
163 
164  mitk::ToolManager *m_ToolManager;
165 
166  QStringList m_OrganColors;
167 
168  QStringList m_LabelStringList;
169 };
170 
171 #endif
Data management class that handles &#39;was created by&#39; relations.
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
DataCollection - Class to facilitate loading/accessing structured data.
A data structure describing a label.
Definition: mitkLabel.h:31
mitk::DataStorage::Pointer m_DataStorage
LabelSetImage class for handling labels and layers in a segmentation session.
unsigned short PixelType
Definition: mitkLabel.h:36
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
#define MITKSEGMENTATIONUI_EXPORT
Manages and coordinates instances of mitk::Tool.