Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMultiWidgetLayoutSelectionWidget.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 QmitkMultiWidgetLayoutSelectionWidget_h
14 #define QmitkMultiWidgetLayoutSelectionWidget_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
19 
20 #include <nlohmann/json.hpp>
21 
22 // qt
23 #include <QWidget>
24 #include <memory>
25 
26 namespace Ui
27 {
29 }
30 
38 {
39  Q_OBJECT
40 
41 public:
42 
43  QmitkMultiWidgetLayoutSelectionWidget(QWidget* parent = nullptr);
45 
46  void SetDataStorage(mitk::DataStorage::Pointer dataStorage);
47 
48 Q_SIGNALS:
49 
50  void LayoutSet(int row, int column);
51  void SetDataBasedLayout(const QList<mitk::DataNode::Pointer>& nodes);
52 
53  // needs to be connected via Qt::DirectConnection (usually default), to ensure the stream pointers validity
54  void SaveLayout(std::ostream* outStream);
55 
56  void LoadLayout(const nlohmann::json* jsonData);
57 
58 private Q_SLOTS:
59 
60  void OnTableItemSelectionChanged();
61  void OnSetLayoutButtonClicked();
62  void OnDataBasedLayoutButtonClicked();
63  void OnSaveLayoutButtonClicked();
64  void OnLoadLayoutButtonClicked();
65  void OnLayoutPresetSelected(int index);
66 
67 private:
68 
69  void Init();
70 
71 
72  std::unique_ptr<Ui::QmitkMultiWidgetLayoutSelectionWidget> ui;
73  std::map<int, nlohmann::json> m_PresetMap;
74  QmitkAutomatedLayoutWidget* m_AutomatedDataLayoutWidget;
75 
76 };
77 
78 #endif
#define MITKQTWIDGETS_EXPORT
Declares QmitkAutomatedLayoutWidget, a widget for selecting data nodes and triggering an automated re...
Widget that lets users select image nodes and request an automated render window layout.
Widget that allows the user to select and apply a layout for a multi widget.
void SaveLayout(std::ostream *outStream)
void SetDataStorage(mitk::DataStorage::Pointer dataStorage)
void SetDataBasedLayout(const QList< mitk::DataNode::Pointer > &nodes)
QmitkMultiWidgetLayoutSelectionWidget(QWidget *parent=nullptr)
void LoadLayout(const nlohmann::json *jsonData)
void LayoutSet(int row, int column)
nlohmann::json json