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//=============================================================================================================
43// EIGEN INCLUDES
44//=============================================================================================================
45
46//=============================================================================================================
47// FORWARD DECLARATIONS
48//=============================================================================================================
49
50class QListWidgetItem;
51
52namespace Ui
53{
54class ChannelSelectionViewWidget;
55} //This must be defined outside of the DISPLIB namespace
56
57namespace FIFFLIB
58{
59class FiffInfo;
60}
61
62//=============================================================================================================
63// DEFINE NAMESPACE DISPLIB
64//=============================================================================================================
65
66namespace DISPLIB
67{
68
69//=============================================================================================================
70// DISPLIB FORWARD DECLARATIONS
71//=============================================================================================================
72
74class SelectionScene;
75
76//=============================================================================================================
86{
87 Q_OBJECT
88
89public:
90 typedef QSharedPointer<ChannelSelectionView> SPtr;
91 typedef QSharedPointer<const ChannelSelectionView> ConstSPtr;
92
93 //=========================================================================================================
102 ChannelSelectionView(const QString& sSettingsPath = "",
103 QWidget* parent = 0,
104 QSharedPointer<ChannelInfoModel> pChannelInfoModel = QSharedPointer<ChannelInfoModel>(0),
105 Qt::WindowType f = Qt::Widget);
106
107 //=========================================================================================================
113
114 //=========================================================================================================
120 void setCurrentlyMappedFiffChannels(const QStringList& mappedLayoutChNames);
121
122 //=========================================================================================================
129 void highlightChannels(QModelIndexList channelIndexList);
130
131 //=========================================================================================================
138 void selectChannels(QStringList channelList);
139
140 //=========================================================================================================
147 QStringList getSelectedChannels();
148
149 //=========================================================================================================
158 QListWidgetItem* getItemForChName(QListWidget* listWidget,
159 const QString& channelName);
160
161 //=========================================================================================================
167 const QMap<QString, QPointF>& getLayoutMap();
168
169 //=========================================================================================================
175 void newFiffFileLoaded(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
176
177 //=========================================================================================================
183 QString getCurrentLayoutFile();
184
185 //=========================================================================================================
191 QString getCurrentGroupFile();
192
193 //=========================================================================================================
199 void setCurrentLayoutFile(QString currentLayoutFile);
200
201 //=========================================================================================================
205 void updateBadChannels();
206
207 //=========================================================================================================
212 void updateDataView();
213
214 //=========================================================================================================
218 void saveSettings();
219
220 //=========================================================================================================
224 void loadSettings();
225
226 //=========================================================================================================
232 void updateGuiMode(GuiMode mode);
233
234 //=========================================================================================================
241
242 //=========================================================================================================
248 QWidget* getViewWidget();
249
250 //=========================================================================================================
256 QWidget* getControlWidget();
257
258 //=========================================================================================================
264 bool isSelectionEmpty();
265
266 //=========================================================================================================
270 void clearView();
271
272private:
273 //=========================================================================================================
278 void initListWidgets();
279
280 //=========================================================================================================
285 void initSelectionSceneView();
286
287 //=========================================================================================================
292 void initComboBoxes();
293
294 //=========================================================================================================
299 void initButtons();
300
301 //=========================================================================================================
306 void initCheckBoxes();
307
308 //=========================================================================================================
314 bool loadLayout(QString path);
315 QString resolveLayoutPath(const QString& layoutFile) const;
316
317 //=========================================================================================================
323 bool loadSelectionGroups(QString path);
324
325 //=========================================================================================================
330 void cleanUpMEGChannels();
331
332 //=========================================================================================================
339 void updateSelectionGroupsList(QListWidgetItem* current,
340 QListWidgetItem* previous);
341
342 //=========================================================================================================
347 void updateSceneItems();
348
349 //=========================================================================================================
354 void updateUserDefinedChannelsList();
355
356 //=========================================================================================================
361 void onBtnLoadUserSelection();
362
363 //=========================================================================================================
368 void onBtnSaveUserSelection();
369
370 //=========================================================================================================
375 void onBtnAddToSelectionGroups();
376
377 //=========================================================================================================
382 void onComboBoxLayoutChanged();
383
384 //=========================================================================================================
389 void resizeEvent(QResizeEvent* event);
390
391 //=========================================================================================================
396 bool eventFilter(QObject* obj, QEvent* event);
397
398 Ui::ChannelSelectionViewWidget* m_pUi;
399
400 QSharedPointer<ChannelInfoModel> m_pChannelInfoModel;
401
402 QMap<QString, QPointF> m_layoutMap;
403 QMultiMap<QString, QStringList> m_selectionGroupsMap;
404
405 SelectionScene* m_pSelectionScene;
406
407 QStringList m_currentlyLoadedFiffChannels;
408
409 QString m_sSettingsPath;
410
411 bool m_bSetup;
412signals:
413 //=========================================================================================================
419 void showSelectedChannelsOnly(QStringList selectedChannels);
420
421 //=========================================================================================================
427 void selectionChanged(const QList<QGraphicsItem*>& selectedChannelItems);
428
429 //=========================================================================================================
435 void loadedLayoutMap(const QMap<QString, QPointF>& layoutMap);
436};
437} // NAMESPACE DISPLIB
438
439#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