v2.0.0
Loading...
Searching...
No Matches
FIFFLIB::FiffEvokedSet Class Reference

Set of FiffEvoked instances sharing one FiffInfo, plus channel-picking and compensation helpers. More...

#include <fiff_evoked_set.h>

Public Types

using SPtr = QSharedPointer<FiffEvokedSet>
using ConstSPtr = QSharedPointer<const FiffEvokedSet>
using UPtr = std::unique_ptr<FiffEvokedSet>
using ConstUPtr = std::unique_ptr<const FiffEvokedSet>

Public Member Functions

 FiffEvokedSet ()
 FiffEvokedSet (QIODevice &p_IODevice)
 FiffEvokedSet (const FiffEvokedSet &p_FiffEvokedSet)
FiffEvokedSet & operator= (const FiffEvokedSet &other)=default
 ~FiffEvokedSet ()
void clear ()
FiffEvokedSet pick_channels (const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
bool compensate_to (fiff_int_t to)
bool find_evoked (const FiffEvokedSet &p_FiffEvokedSet) const
bool save (const QString &fileName) const
bool save (QIODevice &device) const

Static Public Member Functions

static bool read (QIODevice &p_IODevice, FiffEvokedSet &p_FiffEvokedSet, QPair< float, float > baseline=defaultFloatPair, bool proj=true)
static FiffEvokedSet computeGrandAverage (const QList< FiffEvokedSet > &evokedSets)
static FiffEvokedSet computeAverages (const FiffRawData &raw, const AverageDescription &desc, const Eigen::MatrixXi &events, QString &log)
static bool checkArtifacts (const Eigen::MatrixXd &epoch, const FiffInfo &info, const QStringList &bads, const RejectionParams &rej, QString &reason)
static void subtractBaseline (Eigen::MatrixXd &epoch, int bminSamp, int bmaxSamp)
 Subtract baseline from each channel of an epoch.

Public Attributes

FiffInfo info
QList< FiffEvoked > evoked

Detailed Description

Set of FiffEvoked instances sharing one FiffInfo, plus channel-picking and compensation helpers.

The on-disk shape of a *-ave.fif: one FiffInfo and one FiffEvoked per FIFFB_EVOKED block (one per averaging condition). Conversion utilities pick channels and shift compensation state across the whole set in lock-step.

Definition at line 164 of file fiff_evoked_set.h.

Member Typedef Documentation

◆ ConstSPtr

using FIFFLIB::FiffEvokedSet::ConstSPtr = QSharedPointer<const FiffEvokedSet>

Const shared pointer type for FiffEvokedSet.

Definition at line 168 of file fiff_evoked_set.h.

◆ ConstUPtr

using FIFFLIB::FiffEvokedSet::ConstUPtr = std::unique_ptr<const FiffEvokedSet>

Const unique pointer type for FiffEvokedSet.

Definition at line 170 of file fiff_evoked_set.h.

◆ SPtr

Shared pointer type for FiffEvokedSet.

Definition at line 167 of file fiff_evoked_set.h.

◆ UPtr

using FIFFLIB::FiffEvokedSet::UPtr = std::unique_ptr<FiffEvokedSet>

Unique pointer type for FiffEvokedSet.

Definition at line 169 of file fiff_evoked_set.h.

Constructor & Destructor Documentation

◆ FiffEvokedSet() [1/3]

FIFFLIB::FiffEvokedSet::FiffEvokedSet ( )

Constructs a fiff evoked data set.

◆ FiffEvokedSet() [2/3]

FIFFLIB::FiffEvokedSet::FiffEvokedSet ( QIODevice & p_IODevice)

Constructs a fiff evoked data set, by reading from a IO device.

Parameters
[in]p_IODeviceIO device to read from the evoked data set.

◆ FiffEvokedSet() [3/3]

FIFFLIB::FiffEvokedSet::FiffEvokedSet ( const FiffEvokedSet & p_FiffEvokedSet)

Copy constructor.

Parameters
[in]p_FiffEvokedSetFiff evoked data set which should be copied.

◆ ~FiffEvokedSet()

FIFFLIB::FiffEvokedSet::~FiffEvokedSet ( )

Destroys the fiff evoked data set.

Member Function Documentation

◆ checkArtifacts()

bool FIFFLIB::FiffEvokedSet::checkArtifacts ( const Eigen::MatrixXd & epoch,
const FiffInfo & info,
const QStringList & bads,
const RejectionParams & rej,
QString & reason )
static

Check whether an epoch passes artifact rejection criteria.

Parameters
[in]epochEpoch data (nChannels x nSamples).
[in]infoChannel info.
[in]badsList of bad channel names.
[in]rejRejection parameters.
[out]reasonRejection reason string (set only when rejected).
Returns
true if epoch is clean (not rejected).

◆ clear()

void FIFFLIB::FiffEvokedSet::clear ( )

Initializes fiff evoked data set.

◆ compensate_to()

bool FIFFLIB::FiffEvokedSet::compensate_to ( fiff_int_t to)

mne_compensate_to

Changes the CTF gradient compensation grade of all evoked responses in place.

Parameters
[in]toDesired compensation grade.
Returns
true if the data were changed, false if they already had that grade or it is not available.

◆ computeAverages()

FiffEvokedSet FIFFLIB::FiffEvokedSet::computeAverages ( const FiffRawData & raw,
const AverageDescription & desc,
const Eigen::MatrixXi & events,
QString & log )
static

Compute epoch-based averages from raw data according to an averaging description.

For each category in the description, matching events are epoched from the raw data, artifact-rejected, baseline-corrected, and averaged into a FiffEvoked entry.

Parameters
[in]rawThe raw data.
[in]descThe averaging description (categories, rejection, etc.).
[in]eventsEvent matrix (nEvents x 3): [sample, from, to].
[out]logProcessing log output.
Returns
FiffEvokedSet containing one FiffEvoked per category, or empty set on failure.

◆ computeGrandAverage()

FiffEvokedSet FIFFLIB::FiffEvokedSet::computeGrandAverage ( const QList< FiffEvokedSet > & evokedSets)
static

Compute a grand average across multiple evoked data sets (mne.grand_average with interpolate_bads=False, drop_bads=True). For each category, channels marked bad in any set are dropped, the common channels are kept and the sets are combined with equal weights. nave is set to the number of sets and the comment to "Grand average (n = N)".

Parameters
[in]evokedSetsList of evoked data sets to combine.
Returns
The grand-average evoked set, or an empty set if input is empty.

◆ find_evoked()

bool FIFFLIB::FiffEvokedSet::find_evoked ( const FiffEvokedSet & p_FiffEvokedSet) const

fiff_find_evoked

Find evoked data sets

Parameters
[out]p_FiffEvokedSetThe read evoked data set.
Returns
true when any set was found, false otherwise.

◆ operator=()

FiffEvokedSet & FIFFLIB::FiffEvokedSet::operator= ( const FiffEvokedSet & other)
default

Copy assignment. Every member has value semantics, so the compiler-generated member-wise assignment is correct. It is declared explicitly because declaring a copy constructor and/or a destructor deprecates the implicitly generated one.

Parameters
[in]otherObject to assign from.
Returns
reference to this object.

◆ pick_channels()

FiffEvokedSet FIFFLIB::FiffEvokedSet::pick_channels ( const QStringList & include = defaultQStringList,
const QStringList & exclude = defaultQStringList ) const

fiff_pick_channels_evoked

Pick desired channels from evoked-response data

Parameters
[in]include- Channels to include (if empty, include all available).
[in]exclude- Channels to exclude (if empty, do not exclude any).
Returns
the desired fiff evoked data set.

◆ read()

bool FIFFLIB::FiffEvokedSet::read ( QIODevice & p_IODevice,
FiffEvokedSet & p_FiffEvokedSet,
QPair< float, float > baseline = defaultFloatPair,
bool proj = true )
static

fiff_read_evoked

Wrapper for the FiffEvokedDataSet::read_evoked static function

Read one evoked data set

Parameters
[in]p_IODeviceAn fiff IO device like a fiff QFile or QTCPSocket.
[out]p_FiffEvokedSetThe read evoked data set.
[in]baselineThe time interval to apply rescaling / baseline correction. If None do not apply it. If baseline is (a, b). the interval is between "a (s)" and "b (s)". If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal ot (None, None) all the time interval is used. If None, no correction is applied.
[in]projApply SSP projection vectors (optional, default = true).
Returns
true when successful, false otherwise.

◆ save() [1/2]

bool FIFFLIB::FiffEvokedSet::save ( const QString & fileName) const

Save this evoked data set to a FIFF file.

Parameters
[in]fileNameOutput file path.
Returns
true on success.

◆ save() [2/2]

bool FIFFLIB::FiffEvokedSet::save ( QIODevice & device) const

Save this evoked data set as FIFF to an I/O device, e.g. a QBuffer.

Parameters
[in]deviceThe device to write to; it is opened for writing.
Returns
true on success.

◆ subtractBaseline()

void FIFFLIB::FiffEvokedSet::subtractBaseline ( Eigen::MatrixXd & epoch,
int bminSamp,
int bmaxSamp )
static

Subtract baseline from each channel of an epoch.

For each row (channel), the mean of the samples in [bminSamp, bminSamp+nBase) is subtracted.

Parameters
[in,out]epochData matrix (channels x samples) to correct in-place.
[in]bminSampFirst baseline sample (clamped to 0).
[in]bmaxSampLast baseline sample (clamped to epoch length - 1).

Member Data Documentation

◆ evoked

QList<FiffEvoked> FIFFLIB::FiffEvokedSet::evoked

List of Fiff Evoked Data.

Definition at line 360 of file fiff_evoked_set.h.

◆ info

FiffInfo FIFFLIB::FiffEvokedSet::info

FIFF measurement information.

Definition at line 359 of file fiff_evoked_set.h.


The documentation for this class was generated from the following file: