Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QmitkLabelSetWidget_h
18 #define QmitkLabelSetWidget_h
19 
21 
23 #include "mitkLabel.h"
24 #include "mitkNumericTypes.h"
25 #include <ui_QmitkLabelSetWidgetControls.h>
26 
28 class QCompleter;
29 
30 namespace mitk
31 {
32  class LabelSetImage;
33  class LabelSet;
34  class Label;
35  class DataStorage;
36  class ToolManager;
37  class DataNode;
38 }
39 
41 {
42  Q_OBJECT
43 
44 public:
45  explicit QmitkLabelSetWidget(QWidget *parent = NULL);
47 
48  void SetDataStorage(mitk::DataStorage *storage);
49 
50  void SetOrganColors(const QStringList &organColors);
51 
52  void UpdateControls();
53 
54  virtual void setEnabled(bool enabled);
55 
56  QStringList &GetLabelStringList();
57 
58 signals:
59 
61  void goToLabel(const mitk::Point3D &);
62  void resetView();
63 
64 public slots:
65 
66  void ResetAllTableWidgetItems();
67  void UpdateAllTableWidgetItems();
68  void SelectLabelByPixelValue(mitk::Label::PixelType pixelValue);
69 
70 private slots:
71 
72  // Label Set Dependend
73  void OnOpacityChanged(int);
74  void OnUnlockAllLabels(bool);
75  void OnLockAllLabels(bool);
76  void OnSetAllLabelsVisible(bool);
77  void OnSetAllLabelsInvisible(bool);
78  void OnSetOnlyActiveLabelVisible(bool);
79  void OnRandomColor(bool);
80  void OnRemoveLabel(bool);
81  void OnRemoveLabels(bool);
82  void OnRenameLabel(bool);
83  void OnLockedButtonClicked();
84  void OnVisibleButtonClicked();
85  void OnColorButtonClicked();
86  void OnItemClicked(QTableWidgetItem *item);
87  void OnItemDoubleClicked(QTableWidgetItem *item);
88  void OnTableViewContextMenuRequested(const QPoint &);
89  void InsertTableWidgetItem(mitk::Label *label);
90  void UpdateTableWidgetItem(QTableWidgetItem *item);
91  // reaction to "returnPressed" signal from ...
92  void OnSearchLabel();
93  // reaction to the button "Change Label"
94  void OnActiveLabelChanged(int pixelValue);
95 
96  // LabelSetImage Dependet
97  void OnCreateDetailedSurface(bool);
98  void OnCreateSmoothedSurface(bool);
99  // reaction to the signal "createMask" from QmitkLabelSetTableWidget
100  void OnCreateMask(bool);
101  void OnCreateMasks(bool);
102  // reaction to the signal "createCroppedMask" from QmitkLabelSetTableWidget
103  void OnCreateCroppedMask(bool);
104  void OnCombineAndCreateMask(bool);
105  void OnCombineAndCreateSurface(bool);
106  void OnEraseLabel(bool);
107  void OnEraseLabels(bool);
108  // reaction to signal "mergeLabel" from QmitkLabelSetTableWidget
109  void OnMergeLabel(bool);
110  void OnMergeLabels(bool);
111  // reaction to the button "Import Segmentation"
112  void OnImportSegmentation();
113  // reaction to the button "Import Labeled Image"
114  void OnImportLabeledImage();
115 
116  // reaction to signal "labelListModified" from QmitkLabelSetTableWidget
117  void OnLabelListModified(const QStringList &list);
118  // reaction to the signal "toggleOutline" from QmitkLabelSetTableWidget
119  void OnToggleOutline(bool);
120 
121 private:
122  enum TableColumns
123  {
124  NAME_COL = 0,
125  LOCKED_COL,
126  COLOR_COL,
127  VISIBLE_COL
128  };
129 
130  void WaitCursorOn();
131 
132  void WaitCursorOff();
133 
134  void RestoreOverrideCursor();
135 
136  void OnThreadedCalculationDone();
137 
138  void InitializeTableWidget();
139 
140  int GetPixelValueOfSelectedItem();
141 
142  mitk::LabelSetImage *GetWorkingImage();
143 
144  mitk::DataNode *GetWorkingNode();
145 
146  Ui::QmitkLabelSetWidgetControls m_Controls;
147 
148  mitk::ColorSequenceRainbow m_ColorSequenceRainbow;
149 
150  QCompleter *m_Completer;
151 
153 
154  mitk::ToolManager *m_ToolManager;
155 
156  QStringList m_OrganColors;
157 
158  QStringList m_LabelStringList;
159 };
160 
161 #endif
Data management class that handles 'was created by' 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:35
mitk::DataStorage::Pointer m_DataStorage
LabelSetImage class for handling labels and layers in a segmentation session.
unsigned short PixelType
Definition: mitkLabel.h:40
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
#define MITKSEGMENTATIONUI_EXPORT
Manages and coordinates instances of mitk::Tool.