v2.0.0
Loading...
Searching...
No Matches
channelselectionview.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef CHANNELSELECTIONVIEW_H
25#define CHANNELSELECTIONVIEW_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "../disp_global.h"
32#include "abstractview.h"
33
34//=============================================================================================================
35// QT INCLUDES
36//=============================================================================================================
37
38#include <QWidget>
39#include <QListWidget>
40#include <QGraphicsItem>
41
42#include <memory>
43
44//=============================================================================================================
45// EIGEN INCLUDES
46//=============================================================================================================
47
48//=============================================================================================================
49// FORWARD DECLARATIONS
50//=============================================================================================================
51
52class QListWidgetItem;
53
54namespace Ui
55{
56class ChannelSelectionViewWidget;
57} //This must be defined outside of the DISPLIB namespace
58
59namespace FIFFLIB
60{
61class FiffInfo;
62}
63
64//=============================================================================================================
65// DEFINE NAMESPACE DISPLIB
66//=============================================================================================================
67
68namespace DISPLIB
69{
70
71//=============================================================================================================
72// DISPLIB FORWARD DECLARATIONS
73//=============================================================================================================
74
76class SelectionScene;
77
78//=============================================================================================================
88{
89 Q_OBJECT
90
91public:
92 typedef QSharedPointer<ChannelSelectionView> SPtr;
93 typedef QSharedPointer<const ChannelSelectionView> ConstSPtr;
94
95 //=========================================================================================================
104 ChannelSelectionView(const QString& sSettingsPath = "",
105 QWidget* parent = 0,
106 QSharedPointer<ChannelInfoModel> pChannelInfoModel = QSharedPointer<ChannelInfoModel>(0),
107 Qt::WindowType f = Qt::Widget);
108
109 //=========================================================================================================
115
116 //=========================================================================================================
122 void setCurrentlyMappedFiffChannels(const QStringList& mappedLayoutChNames);
123
124 //=========================================================================================================
131 void highlightChannels(QModelIndexList channelIndexList);
132
133 //=========================================================================================================
140 void selectChannels(QStringList channelList);
141
142 //=========================================================================================================
149 QStringList getSelectedChannels();
150
151 //=========================================================================================================
160 QListWidgetItem* getItemForChName(QListWidget* listWidget,
161 const QString& channelName);
162
163 //=========================================================================================================
169 const QMap<QString, QPointF>& getLayoutMap();
170
171 //=========================================================================================================
177 void newFiffFileLoaded(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
178
179 //=========================================================================================================
185 QString getCurrentLayoutFile();
186
187 //=========================================================================================================
193 QString getCurrentGroupFile();
194
195 //=========================================================================================================
201 void setCurrentLayoutFile(QString currentLayoutFile);
202
203 //=========================================================================================================
207 void updateBadChannels();
208
209 //=========================================================================================================
214 void updateDataView();
215
216 //=========================================================================================================
220 void saveSettings();
221
222 //=========================================================================================================
226 void loadSettings();
227
228 //=========================================================================================================
234 void updateGuiMode(GuiMode mode);
235
236 //=========================================================================================================
243
244 //=========================================================================================================
250 QWidget* getViewWidget();
251
252 //=========================================================================================================
258 QWidget* getControlWidget();
259
260 //=========================================================================================================
266 bool isSelectionEmpty();
267
268 //=========================================================================================================
272 void clearView();
273
274private:
275 //=========================================================================================================
280 void initListWidgets();
281
282 //=========================================================================================================
287 void initSelectionSceneView();
288
289 //=========================================================================================================
294 void initComboBoxes();
295
296 //=========================================================================================================
301 void initButtons();
302
303 //=========================================================================================================
308 void initCheckBoxes();
309
310 //=========================================================================================================
316 bool loadLayout(QString path);
317 QString resolveLayoutPath(const QString& layoutFile) const;
318
319 //=========================================================================================================
325 bool loadSelectionGroups(QString path);
326
327 //=========================================================================================================
332 void cleanUpMEGChannels();
333
334 //=========================================================================================================
341 void updateSelectionGroupsList(QListWidgetItem* current,
342 QListWidgetItem* previous);
343
344 //=========================================================================================================
349 void updateSceneItems();
350
351 //=========================================================================================================
356 void updateUserDefinedChannelsList();
357
358 //=========================================================================================================
363 void onBtnLoadUserSelection();
364
365 //=========================================================================================================
370 void onBtnSaveUserSelection();
371
372 //=========================================================================================================
377 void onBtnAddToSelectionGroups();
378
379 //=========================================================================================================
384 void onComboBoxLayoutChanged();
385
386 //=========================================================================================================
391 void resizeEvent(QResizeEvent* event);
392
393 //=========================================================================================================
398 bool eventFilter(QObject* obj, QEvent* event);
399
400 std::unique_ptr<Ui::ChannelSelectionViewWidget> m_pUi;
401
402 QSharedPointer<ChannelInfoModel> m_pChannelInfoModel;
403
404 QMap<QString, QPointF> m_layoutMap;
405 QMultiMap<QString, QStringList> m_selectionGroupsMap;
406
407 SelectionScene* m_pSelectionScene;
408
409 QStringList m_currentlyLoadedFiffChannels;
410
411 QString m_sSettingsPath;
412
413 bool m_bSetup;
414signals:
415 //=========================================================================================================
421 void showSelectedChannelsOnly(QStringList selectedChannels);
422
423 //=========================================================================================================
429 void selectionChanged(const QList<QGraphicsItem*>& selectedChannelItems);
430
431 //=========================================================================================================
437 void loadedLayoutMap(const QMap<QString, QPointF>& layoutMap);
438};
439} // NAMESPACE DISPLIB
440
441#endif // CHANNELSELECTIONVIEW_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
Common base widget for every dockable Quick-Control settings panel in DISPLIB.
FIFF file I/O, in-memory data structures and high-level readers/writers.
2-D display widgets and visualisation helpers (charts, topography, colour maps).
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void selectionChanged(const QList< QGraphicsItem * > &selectedChannelItems)
QSharedPointer< ChannelSelectionView > SPtr
QListWidgetItem * getItemForChName(QListWidget *listWidget, const QString &channelName)
const QMap< QString, QPointF > & getLayoutMap()
void showSelectedChannelsOnly(QStringList selectedChannels)
void updateProcessingMode(ProcessingMode mode)
ChannelSelectionView(const QString &sSettingsPath="", QWidget *parent=0, QSharedPointer< ChannelInfoModel > pChannelInfoModel=QSharedPointer< ChannelInfoModel >(0), Qt::WindowType f=Qt::Widget)
void highlightChannels(QModelIndexList channelIndexList)
void newFiffFileLoaded(QSharedPointer< FIFFLIB::FiffInfo > &pFiffInfo)
void selectChannels(QStringList channelList)
QSharedPointer< const ChannelSelectionView > ConstSPtr
void setCurrentlyMappedFiffChannels(const QStringList &mappedLayoutChNames)
void loadedLayoutMap(const QMap< QString, QPointF > &layoutMap)
void setCurrentLayoutFile(QString currentLayoutFile)
QAbstractTableModel exposing per-channel FIFF metadata (name, type, unit, position,...
QGraphicsScene of sensor-layout dots used by ChannelSelectionView for interactive channel picking.
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:90