17 #ifndef QMITKLEVELWINDOWPRESETDEFINITIONDIALOG_H_
18 #define QMITKLEVELWINDOWPRESETDEFINITIONDIALOG_H_
22 #include "ui_QmitkLevelWindowPresetDefinition.h"
25 #include <QSortFilterProxyModel>
32 public Ui::QmitkLevelWindowPresetDefinition
40 void setPresets(std::map<std::string, double> &level,
41 std::map<std::string, double> &window,
45 std::map<std::string, double> getLevelPresets();
47 std::map<std::string, double> getWindowPresets();
55 void ListViewSelectionChanged(
const QItemSelection &,
const QItemSelection &);
56 void sortPresets(
int index);
68 Entry(
const std::string &n,
double l,
double w) : name(n), level(l), window(w) {}
72 std::map<std::string, double> &windows,
73 QObject *parent =
nullptr);
75 int rowCount(
const QModelIndex &)
const override;
76 int columnCount(
const QModelIndex &)
const override;
77 QVariant data(
const QModelIndex &index,
int)
const override;
79 QVariant headerData(
int section, Qt::Orientation orientation,
int)
const override;
81 void addPreset(std::string &name,
double level,
double window);
82 void removePreset(
const QModelIndex &);
83 void changePreset(
int row, std::string &name,
double level,
double window);
85 void getLevels(std::map<std::string, double> &levels);
86 void getWindows(std::map<std::string, double> &windows);
88 bool contains(std::string &name);
90 Entry getPreset(
const QModelIndex &)
const;
93 std::vector<Entry> m_Entries;
96 void resizeEvent(QResizeEvent *event)
override;
97 void showEvent(QShowEvent *event)
override;
Entry(const std::string &n, double l, double w)
PresetTableModel * m_TableModel
QSortFilterProxyModel m_SortModel