v2.0.0
Loading...
Searching...
No Matches
channelselectionview.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef CHANNELSELECTIONVIEW_H
38#define CHANNELSELECTIONVIEW_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "../disp_global.h"
45#include "abstractview.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QWidget>
52#include <QListWidget>
53#include <QGraphicsItem>
54
55//=============================================================================================================
56// EIGEN INCLUDES
57//=============================================================================================================
58
59//=============================================================================================================
60// FORWARD DECLARATIONS
61//=============================================================================================================
62
63class QListWidgetItem;
64
65namespace Ui {
66 class ChannelSelectionViewWidget;
67} //This must be defined outside of the DISPLIB namespace
68
69namespace FIFFLIB {
70 class FiffInfo;
71}
72
73//=============================================================================================================
74// DEFINE NAMESPACE DISPLIB
75//=============================================================================================================
76
77namespace DISPLIB
78{
79
80//=============================================================================================================
81// DISPLIB FORWARD DECLARATIONS
82//=============================================================================================================
83
85class SelectionScene;
86
93{
94 Q_OBJECT
95
96public:
97 typedef QSharedPointer<ChannelSelectionView> SPtr;
98 typedef QSharedPointer<const ChannelSelectionView> ConstSPtr;
99
100 //=========================================================================================================
107 ChannelSelectionView(const QString& sSettingsPath = "",
108 QWidget *parent = 0,
109 QSharedPointer<ChannelInfoModel> pChannelInfoModel = QSharedPointer<ChannelInfoModel>(0),
110 Qt::WindowType f = Qt::Widget);
111
112 //=========================================================================================================
118
119 //=========================================================================================================
125 void setCurrentlyMappedFiffChannels(const QStringList &mappedLayoutChNames);
126
127 //=========================================================================================================
134 void highlightChannels(QModelIndexList channelIndexList);
135
136 //=========================================================================================================
143 void selectChannels(QStringList channelList);
144
145 //=========================================================================================================
150 QStringList getSelectedChannels();
151
152 //=========================================================================================================
159 QListWidgetItem* getItemForChName(QListWidget *listWidget,
160 const QString& channelName);
161
162 //=========================================================================================================
166 const QMap<QString,QPointF>& getLayoutMap();
167
168 //=========================================================================================================
172 void newFiffFileLoaded(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
173
174 //=========================================================================================================
180 QString getCurrentLayoutFile();
181
182 //=========================================================================================================
188 QString getCurrentGroupFile();
189
190 //=========================================================================================================
196 void setCurrentLayoutFile(QString currentLayoutFile);
197
198 //=========================================================================================================
202 void updateBadChannels();
203
204 //=========================================================================================================
209 void updateDataView();
210
211 //=========================================================================================================
215 void saveSettings();
216
217 //=========================================================================================================
221 void loadSettings();
222
223 //=========================================================================================================
229 void updateGuiMode(GuiMode mode);
230
231 //=========================================================================================================
238
239 //=========================================================================================================
245 QWidget* getViewWidget();
246
247 //=========================================================================================================
253 QWidget* getControlWidget();
254
255 //=========================================================================================================
261 bool isSelectionEmpty();
262
263 //=========================================================================================================
267 void clearView();
268
269private:
270 //=========================================================================================================
275 void initListWidgets();
276
277 //=========================================================================================================
282 void initSelectionSceneView();
283
284 //=========================================================================================================
289 void initComboBoxes();
290
291 //=========================================================================================================
296 void initButtons();
297
298 //=========================================================================================================
303 void initCheckBoxes();
304
305 //=========================================================================================================
311 bool loadLayout(QString path);
312 QString resolveLayoutPath(const QString& layoutFile) const;
313
314 //=========================================================================================================
320 bool loadSelectionGroups(QString path);
321
322 //=========================================================================================================
327 void cleanUpMEGChannels();
328
329 //=========================================================================================================
336 void updateSelectionGroupsList(QListWidgetItem* current,
337 QListWidgetItem* previous);
338
339 //=========================================================================================================
344 void updateSceneItems();
345
346 //=========================================================================================================
351 void updateUserDefinedChannelsList();
352
353 //=========================================================================================================
358 void onBtnLoadUserSelection();
359
360 //=========================================================================================================
365 void onBtnSaveUserSelection();
366
367 //=========================================================================================================
372 void onBtnAddToSelectionGroups();
373
374 //=========================================================================================================
379 void onComboBoxLayoutChanged();
380
381 //=========================================================================================================
386 void resizeEvent(QResizeEvent* event);
387
388 //=========================================================================================================
393 bool eventFilter(QObject *obj, QEvent *event);
394
395 Ui::ChannelSelectionViewWidget* m_pUi;
396
397 QSharedPointer<ChannelInfoModel> m_pChannelInfoModel;
398
399 QMap<QString,QPointF> m_layoutMap;
400 QMultiMap<QString,QStringList> m_selectionGroupsMap;
401
402 SelectionScene* m_pSelectionScene;
403
404 QStringList m_currentlyLoadedFiffChannels;
405
406 QString m_sSettingsPath;
407
408 bool m_bSetup;
409signals:
410 //=========================================================================================================
416 void showSelectedChannelsOnly(QStringList selectedChannels);
417
418 //=========================================================================================================
424 void selectionChanged(const QList<QGraphicsItem*> &selectedChannelItems);
425
426 //=========================================================================================================
432 void loadedLayoutMap(const QMap<QString,QPointF> &layoutMap);
433};
434} // NAMESPACE DISPLIB
435
436#endif // CHANNELSELECTIONVIEW_H
disp library export/import macros.
#define DISPSHARED_EXPORT
Definition disp_global.h:51
Declaration of the AbstractView Class.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
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)
Table model exposing per-channel metadata (name, type, unit, position) for QTableView display.
The SelectionScene class provides a reimplemented QGraphicsScene for 2D layout plotting.
FIFF measurement file information.
Definition fiff_info.h:86