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 class ChannelSelectionViewWidget;
54} //This must be defined outside of the DISPLIB namespace
55
56namespace FIFFLIB {
57 class FiffInfo;
58}
59
60//=============================================================================================================
61// DEFINE NAMESPACE DISPLIB
62//=============================================================================================================
63
64namespace DISPLIB
65{
66
67//=============================================================================================================
68// DISPLIB FORWARD DECLARATIONS
69//=============================================================================================================
70
72class SelectionScene;
73
74//=============================================================================================================
84{
85 Q_OBJECT
86
87public:
88 typedef QSharedPointer<ChannelSelectionView> SPtr;
89 typedef QSharedPointer<const ChannelSelectionView> ConstSPtr;
90
91 //=========================================================================================================
98 ChannelSelectionView(const QString& sSettingsPath = "",
99 QWidget *parent = 0,
100 QSharedPointer<ChannelInfoModel> pChannelInfoModel = QSharedPointer<ChannelInfoModel>(0),
101 Qt::WindowType f = Qt::Widget);
102
103 //=========================================================================================================
109
110 //=========================================================================================================
116 void setCurrentlyMappedFiffChannels(const QStringList &mappedLayoutChNames);
117
118 //=========================================================================================================
125 void highlightChannels(QModelIndexList channelIndexList);
126
127 //=========================================================================================================
134 void selectChannels(QStringList channelList);
135
136 //=========================================================================================================
141 QStringList getSelectedChannels();
142
143 //=========================================================================================================
150 QListWidgetItem* getItemForChName(QListWidget *listWidget,
151 const QString& channelName);
152
153 //=========================================================================================================
157 const QMap<QString,QPointF>& getLayoutMap();
158
159 //=========================================================================================================
163 void newFiffFileLoaded(QSharedPointer<FIFFLIB::FiffInfo>& pFiffInfo);
164
165 //=========================================================================================================
171 QString getCurrentLayoutFile();
172
173 //=========================================================================================================
179 QString getCurrentGroupFile();
180
181 //=========================================================================================================
187 void setCurrentLayoutFile(QString currentLayoutFile);
188
189 //=========================================================================================================
193 void updateBadChannels();
194
195 //=========================================================================================================
200 void updateDataView();
201
202 //=========================================================================================================
206 void saveSettings();
207
208 //=========================================================================================================
212 void loadSettings();
213
214 //=========================================================================================================
220 void updateGuiMode(GuiMode mode);
221
222 //=========================================================================================================
229
230 //=========================================================================================================
236 QWidget* getViewWidget();
237
238 //=========================================================================================================
244 QWidget* getControlWidget();
245
246 //=========================================================================================================
252 bool isSelectionEmpty();
253
254 //=========================================================================================================
258 void clearView();
259
260private:
261 //=========================================================================================================
266 void initListWidgets();
267
268 //=========================================================================================================
273 void initSelectionSceneView();
274
275 //=========================================================================================================
280 void initComboBoxes();
281
282 //=========================================================================================================
287 void initButtons();
288
289 //=========================================================================================================
294 void initCheckBoxes();
295
296 //=========================================================================================================
302 bool loadLayout(QString path);
303 QString resolveLayoutPath(const QString& layoutFile) const;
304
305 //=========================================================================================================
311 bool loadSelectionGroups(QString path);
312
313 //=========================================================================================================
318 void cleanUpMEGChannels();
319
320 //=========================================================================================================
327 void updateSelectionGroupsList(QListWidgetItem* current,
328 QListWidgetItem* previous);
329
330 //=========================================================================================================
335 void updateSceneItems();
336
337 //=========================================================================================================
342 void updateUserDefinedChannelsList();
343
344 //=========================================================================================================
349 void onBtnLoadUserSelection();
350
351 //=========================================================================================================
356 void onBtnSaveUserSelection();
357
358 //=========================================================================================================
363 void onBtnAddToSelectionGroups();
364
365 //=========================================================================================================
370 void onComboBoxLayoutChanged();
371
372 //=========================================================================================================
377 void resizeEvent(QResizeEvent* event);
378
379 //=========================================================================================================
384 bool eventFilter(QObject *obj, QEvent *event);
385
386 Ui::ChannelSelectionViewWidget* m_pUi;
387
388 QSharedPointer<ChannelInfoModel> m_pChannelInfoModel;
389
390 QMap<QString,QPointF> m_layoutMap;
391 QMultiMap<QString,QStringList> m_selectionGroupsMap;
392
393 SelectionScene* m_pSelectionScene;
394
395 QStringList m_currentlyLoadedFiffChannels;
396
397 QString m_sSettingsPath;
398
399 bool m_bSetup;
400signals:
401 //=========================================================================================================
407 void showSelectedChannelsOnly(QStringList selectedChannels);
408
409 //=========================================================================================================
415 void selectionChanged(const QList<QGraphicsItem*> &selectedChannelItems);
416
417 //=========================================================================================================
423 void loadedLayoutMap(const QMap<QString,QPointF> &layoutMap);
424};
425} // NAMESPACE DISPLIB
426
427#endif // CHANNELSELECTIONVIEW_H
Common base widget for every dockable Quick-Control settings panel in DISPLIB.
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
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:88