MNE-CPP  beta 1.0
Classes
rawmodel.h File Reference

This class represents the model of the model/view framework of mne_browse_raw_qt application. It is derived from QAbstractTableModel so the virtual functions rowCount(),columnCount() and data() needed to be reimplemented. The delegate requests the data for any individual table cell by invoking data(QModelIndex index, int role) and a certain role. DisplayRole is the standard role for requesting the plain data. Other roles such as BackgroundRole are requested to fill a cell with a certain background color with respect to the individual index. For further information see [1]. More...

#include "../Utils/types.h"
#include "../Utils/filteroperator.h"
#include "../Utils/rawsettings.h"
#include "../Utils/datapackage.h"
#include <QDebug>
#include <QAbstractTableModel>
#include <QMetaEnum>
#include <QBrush>
#include <QPalette>
#include <QtConcurrent>
#include <QProgressDialog>
#include <Eigen/Core>
#include <Eigen/SparseCore>
#include <unsupported/Eigen/FFT>
#include <fiff/fiff.h>
#include <mne/mne.h>
#include <utils/parksmcclellan.h>

Go to the source code of this file.

Classes

class  MNEBrowseRawQt::RawModel
 

Detailed Description

This class represents the model of the model/view framework of mne_browse_raw_qt application. It is derived from QAbstractTableModel so the virtual functions rowCount(),columnCount() and data() needed to be reimplemented. The delegate requests the data for any individual table cell by invoking data(QModelIndex index, int role) and a certain role. DisplayRole is the standard role for requesting the plain data. Other roles such as BackgroundRole are requested to fill a cell with a certain background color with respect to the individual index. For further information see [1].

Author
Florian Schlembach flori.nosp@m.an.s.nosp@m.chlem.nosp@m.bach.nosp@m.@tu-i.nosp@m.lmen.nosp@m.au.de; Christoph Dinh chdin.nosp@m.h@nm.nosp@m.r.mgh.nosp@m..har.nosp@m.vard..nosp@m.edu; Matti Hamalainen msh@n.nosp@m.mr.m.nosp@m.gh.ha.nosp@m.rvar.nosp@m.d.edu; Jens Haueisen jens..nosp@m.haue.nosp@m.isen@.nosp@m.tu-i.nosp@m.lmena.nosp@m.u.de
Version
1.0
Date
January, 2014

LICENSE

Copyright (C) 2014, Florian Schlembach, Christoph Dinh, Matti Hamalainen and Jens Haueisen. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

      The way how the data is organized is totally up to the model. In our case, the raw and processed
      data is stored in stored in the two matrices m_data[i] and m_procData[i] (both are QList that contains MatrixXdR), respectively. (nchans x m_iWindowSize)
      The data is loaded and displayed blockwise. If the user scrolls close (meaning distanced smaller than
      m_iReloadPos) to the loaded edge, the subsequent block is loaded from the fiff file. The maximum number
      of loaded window blocks is determined by the parameter m_maxWindows. If m_maxWindows is reached and another
      block is to be loaded, the first or last block (depending on whether the user scrolls to the right or left edge)
      is removed from m_data, pretty much like a circular buffer. The logic of the reloading is managed by the
      slot updateScrollPos, which obtains the value from the horizontal QScrollBar being part of the connected TableView.

      In order to not freeze the GUI when reloading new data or filtering data, the RawModel class makes heavy use
      of the QtConcurrent features. [2]
      Therefore, the methods updateOperatorsConcurrently() and readSegment() is run in a background-thread. Once the results
      are ready the m_operatorFutureWatcher and m_reloadFutureWatcher emits a signal that is connect to the slots
      insertProcessedData() and insertReloadedData(), respectively.

      MNEOperators such as FilterOperators are stored in m_Operators. The MNEOperators that are applied to any
      individual channel are stored in the QMap m_assignedOperators.

      [1] http://qt-project.org/doc/qt-5/QAbstractTableModel.html
      [2] http://qt-project.org/doc/qt-5.0/qtconcurrent/qtconcurrent-index.html

Definition in file rawmodel.h.