13 #ifndef QmitkLevelWindowPresetDefinitionDialog_h
14 #define QmitkLevelWindowPresetDefinitionDialog_h
18 #include "ui_QmitkLevelWindowPresetDefinition.h"
21 #include <QSortFilterProxyModel>
28 public Ui::QmitkLevelWindowPresetDefinition
36 void setPresets(std::map<std::string, double> &level,
37 std::map<std::string, double> &window,
41 std::map<std::string, double> getLevelPresets();
43 std::map<std::string, double> getWindowPresets();
51 void ListViewSelectionChanged(
const QItemSelection &,
const QItemSelection &);
52 void sortPresets(
int index);
64 Entry(
const std::string &n,
double l,
double w) : name(n), level(l), window(w) {}
68 std::map<std::string, double> &windows,
69 QObject *parent =
nullptr);
71 int rowCount(
const QModelIndex &)
const override;
72 int columnCount(
const QModelIndex &)
const override;
73 QVariant data(
const QModelIndex &index,
int)
const override;
75 QVariant headerData(
int section, Qt::Orientation orientation,
int)
const override;
77 void addPreset(std::string &name,
double level,
double window);
78 void removePreset(
const QModelIndex &);
79 void changePreset(
int row, std::string &name,
double level,
double window);
81 void getLevels(std::map<std::string, double> &levels);
82 void getWindows(std::map<std::string, double> &windows);
84 bool contains(std::string &name);
86 Entry getPreset(
const QModelIndex &)
const;
89 std::vector<Entry> m_Entries;
92 void resizeEvent(QResizeEvent *event)
override;
93 void showEvent(QShowEvent *event)
override;