Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms). More...
Classes | |
| struct | AnnotateMusclParams |
| Parameters for muscle artifact annotation. More... | |
| struct | AnnotateAmplitudeParams |
| Parameters for amplitude-based annotation. More... | |
| struct | ArtifactDetectEcgParams |
| ECG R-peak detection parameters (defined outside class to avoid Clang/GCC default-argument issues with nested structs). More... | |
| struct | ArtifactDetectEogParams |
| EOG blink / saccade detection parameters (defined outside class to avoid Clang/GCC default-argument issues with nested structs). More... | |
| class | ArtifactDetect |
| ECG and EOG physiological artifact event detection. More... | |
| struct | BadChannelDetectParams |
| Bad-channel detection parameters (defined outside class to avoid Clang/GCC default-argument issues with nested structs). More... | |
| class | BadChannelDetect |
| Automated detection of bad MEG/EEG channels using flat, variance, and correlation criteria. More... | |
| struct | LofBadChannelParams |
| struct | BadChannelsMaxwellParams |
| Parameters for SSS-based bad channel detection. More... | |
| struct | BadChannelsMaxwellResult |
| Result of SSS-based bad channel detection. More... | |
| struct | BridgedElectrodeParams |
| struct | DerivationRule |
| A single derivation rule mapping input channels (with weights) to one output channel. More... | |
| class | ChannelDerivation |
| Channel derivation and re-referencing utilities. More... | |
| class | ConnectivityAec |
| Amplitude Envelope Correlation connectivity. More... | |
| class | CosineFilter |
| Creates a cosine filter response in the frequency domain. More... | |
| struct | CsdResult |
| Result of a Cross-Spectral Density computation. More... | |
| class | Csd |
| Cross-Spectral Density (CSD) estimator. More... | |
| struct | DpssResult |
| Result of a DPSS taper computation. More... | |
| class | Dpss |
| Discrete Prolate Spheroidal Sequences (Slepian tapers). More... | |
| class | EogRegression |
| Remove EOG artifacts via linear regression. More... | |
| struct | EpochExtractorParams |
| Epoch extraction parameters (defined outside class to avoid Clang/GCC default-argument issues with nested structs). More... | |
| class | EpochExtractor |
| Segments continuous raw data into fixed-length epochs locked to events. More... | |
| struct | InfomaxResult |
| class | ExtendedInfomax |
| struct | FilterChpiParams |
| Parameters for cHPI notch filtering. More... | |
| class | FilterIO |
| Processes txt files which hold filter coefficients. More... | |
| class | FilterParameter |
| Named filter-design parameter descriptor holding a human-readable name and description (e.g. design method or filter type). More... | |
| class | FilterKernel |
| The FilterKernel class provides methods to create/design a FIR filter kernel. More... | |
| struct | FineCalEntry |
| Per-sensor fine calibration entry. More... | |
| class | FineCalibration |
| Fine calibration data for SSS. More... | |
| class | FirFilter |
| Discoverable façade over the FilterKernel FIR-filter engine. More... | |
| struct | IcaResult |
| Result of an ICA decomposition. More... | |
| class | ICA |
| Independent Component Analysis using the FastICA algorithm (deflationary, logcosh nonlinearity). More... | |
| struct | IirBiquad |
| Coefficients of one second-order IIR section (biquad). More... | |
| class | IirFilter |
| Butterworth IIR filter design and application using second-order sections. More... | |
| struct | HeadPosEntry |
| A head position entry (time, translation, rotation quaternion). More... | |
| struct | MaxwellMoveCompParams |
| Parameters for Maxwell movement compensation. More... | |
| class | MaxwellMovementComp |
| Maxwell movement compensation using SSS. More... | |
| struct | MorletTfrResult |
| Result of a Morlet TFR computation for one channel. More... | |
| class | MorletTfr |
| Complex Morlet wavelet time-frequency representation. More... | |
| struct | MultitaperPsdResult |
| Result of a multitaper PSD computation. More... | |
| class | MultitaperPsd |
| Multitaper power spectral density estimator using DPSS (Slepian) tapers. More... | |
| struct | MultitaperTfrResult |
| Result of a multitaper TFR computation. More... | |
| class | MultitaperTfr |
| Sliding-window multitaper time-frequency representation. More... | |
| class | ParksMcClellan |
| Parks-McClellan equiripple FIR filter design algorithm (Remez exchange). More... | |
| struct | PeakFinderParams |
| class | PicardIca |
| Independent Component Analysis using the Picard algorithm. More... | |
| class | Resample |
| Polyphase anti-aliased rational resampling for MEG/EEG data. More... | |
| struct | SimulateStcParams |
| Parameters for source time course simulation. More... | |
| struct | SpectogramInputData |
| Input parameters for short-time Fourier transform spectrogram computation. More... | |
| class | Spectrogram |
| Computes time-frequency spectrograms via short-time Fourier transform with configurable window and overlap. More... | |
| struct | SSSParams |
| Implements Signal Space Separation (SSS) and temporal SSS (tSSS) for MEG data. More... | |
| class | SSS |
| struct | SurfaceLaplacianResult |
| Result of a surface Laplacian (CSD) computation. More... | |
| class | SurfaceLaplacian |
| Surface Laplacian / Current Source Density (CSD) transformation. More... | |
| struct | WelchPsdResult |
| Result of a Welch PSD computation. More... | |
| class | WelchPsd |
| Welch's averaged-periodogram power spectral density estimator. More... | |
| struct | XdawnResult |
| Result of an xDAWN decomposition. More... | |
| class | Xdawn |
| Event-related response enhancement with xDAWN spatial filtering. More... | |
| class | KMeans |
| Lloyd-style K-means clustering with configurable metric, seeding and replicates. More... | |
| class | Linalg |
| Static Eigen-based linear-algebra helpers used across MATHLIB and the inverse solvers. More... | |
| class | Numerics |
| Static scalar/per-vector numerical helpers (GCD, log2, histograms, baseline rescaling). More... | |
| class | SimplexAlgorithm |
| Header-only Nelder–Mead simplex minimiser with templated cost and report functors. More... | |
| struct | TaperedSpectraInputData |
| Per-row input bundle for parallel multi-taper spectral estimation (data row, taper matrix, FFT length). More... | |
| class | Spectral |
| Static multi-taper spectra, PSD and CSD estimator for MEG/EEG time series. More... | |
| struct | FitUser |
Cost-function workspace for Sphere::fit_sphere_simplex: holds the nx3 point cloud and a verbose-report flag. More... | |
| class | Sphere |
| 3-D sphere value type with algebraic and Nelder–Mead best-fit factories. More... | |
| class | Warp |
| Thin-plate-spline 3-D warp fitted from landmark correspondences. More... | |
| class | CircularBuffer |
| Thread-safe lock-free circular (ring) buffer for producer-consumer data exchange between threads. More... | |
| class | ICommand |
| The ICommand interface provides the base class of every command of the command design pattern. More... | |
| class | MNELogger |
| Custom Qt message handler that formats and routes qDebug/qWarning/qCritical output to file or console. More... | |
| class | IObserver |
| The IObserver interface provides the base class of every observer of the observer design pattern. More... | |
| class | Subject |
| The Subject class provides the base class of every subject of the observer design pattern. More... | |
| class | IOUtils |
| Eigen matrix I/O utilities. More... | |
| class | LayoutLoader |
| Reads ANT .elc electrode files and MNE .lout 2-D channel layouts into Qt/STL containers. More... | |
| struct | fitUserRec |
| Workspace for sphere-fitting used by the layout maker, holding 3-D point coordinates and fit parameters. More... | |
| class | LayoutMaker |
| Make layout files from given 3D points. More... | |
| struct | ElectrodePosition |
| Represents an electrode position in a montage. More... | |
| class | StandardMontage |
| Standard EEG montage with named electrode positions. More... | |
| struct | DigitizedPoint |
| A single digitised point captured during the alignment session. More... | |
| class | AcquiredPoints |
| In-memory store of all points captured during a session. More... | |
| struct | FastrakSample |
| One decoded sample from a Fastrak ASCII stream. More... | |
| class | FastrakParser |
| Streaming parser for Fastrak / FastSCAN ASCII records. More... | |
| struct | PolhemusSerialConfig |
| Settings used to open a real Polhemus serial connection. More... | |
| class | PolhemusConnection |
| Polhemus digitizer connection (mock + serial-port backends). More... | |
| class | PolhemusCoregistration |
| Head–device coregistration engine driven by a Polhemus Fastrak. More... | |
| struct | PythonRunnerResult |
| Script execution result container. More... | |
| struct | PythonRunnerConfig |
| Script execution configuration. More... | |
| class | PythonRunner |
| Python script launcher with logging and progress support. More... | |
| class | PythonTestHelper |
| struct | ReportSection |
| A section in the report (title + HTML content). More... | |
| class | Report |
| Simple HTML report builder for MEG/EEG analysis results. More... | |
| class | SelectionIO |
| Reader/writer for MNE .sel channel-selection files and Brainstorm .mon montage files. More... | |
Typedefs | |
| typedef CircularBuffer< int > | CircularBuffer_int |
| typedef CircularBuffer< short > | CircularBuffer_short |
| typedef CircularBuffer< char > | CircularBuffer_char |
| typedef CircularBuffer< double > | CircularBuffer_double |
| typedef CircularBuffer< QPair< int, int > > | CircularBuffer_pair_int_int |
| typedef CircularBuffer< QPair< double, double > > | CircularBuffer_pair_double_double |
| typedef CircularBuffer< Eigen::MatrixXd > | CircularBuffer_Matrix_double |
| typedef CircularBuffer< Eigen::MatrixXf > | CircularBuffer_Matrix_float |
| using | fitUser = fitUserRec* |
| using | PythonLineCallback = std::function<void(int channel, const QString& line)> |
| using | PythonProgressCallback = std::function<void(float pct, const QString& msg)> |
Enumerations | |
| enum class | StimArtifactMode { Linear , Window } |
| Mode for stimulus artifact repair. More... | |
| enum class | KMeansDistance { SquaredEuclidean , CityBlock , Cosine , Correlation , Hamming } |
| Distance metric for K-Means clustering. More... | |
| enum class | KMeansStart { Sample , Uniform , Cluster } |
| Initialization strategy for K-Means clustering. More... | |
| enum class | KMeansEmptyAction { Error , Drop , Singleton } |
| Action to take when a K-Means cluster becomes empty. More... | |
| enum class | PointKind { Fiducial = 0 , Eeg , HeadShape } |
| Logical category of a captured point. More... | |
| enum class | FiducialId { LPA = 1 , NAS = 2 , RPA = 3 } |
| Identifier for the three cardinal fiducials. More... | |
Functions | |
| DSPSHARED_EXPORT FIFFLIB::FiffAnnotations | annotateMusclZscore (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, double sfreq, const AnnotateMusclParams ¶ms=AnnotateMusclParams()) |
| Detect muscle artifacts via high-frequency z-score and annotate bad segments. | |
| DSPSHARED_EXPORT FIFFLIB::FiffAnnotations | annotateAmplitude (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, double sfreq, const AnnotateAmplitudeParams ¶ms=AnnotateAmplitudeParams()) |
| Annotate segments where amplitude exceeds thresholds or is too flat. | |
| DSPSHARED_EXPORT QStringList | findBadChannelsLof (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const LofBadChannelParams ¶ms=LofBadChannelParams()) |
| Detect bad channels using Local Outlier Factor (LOF). | |
| DSPSHARED_EXPORT Eigen::VectorXd | computeLofScores (const Eigen::MatrixXd &features, int k) |
| Compute LOF scores for a feature matrix. | |
| DSPSHARED_EXPORT BadChannelsMaxwellResult | findBadChannelsMaxwell (const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &info, const BadChannelsMaxwellParams ¶ms=BadChannelsMaxwellParams()) |
| Detect bad MEG channels using SSS reconstruction residuals. | |
| DSPSHARED_EXPORT Eigen::MatrixXd | computeElectricalDistance (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info) |
| Compute electrical distance matrix between EEG channels. | |
| DSPSHARED_EXPORT QList< QPair< int, int > > | computeBridgedElectrodes (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const BridgedElectrodeParams ¶ms=BridgedElectrodeParams()) |
| Detect bridged EEG electrodes. | |
| DSPSHARED_EXPORT void | setEegReference (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &refChannels=QStringList(), bool projection=false) |
| Re-reference EEG channels to average, specific channel(s), or REST. | |
| DSPSHARED_EXPORT void | addReferenceChannels (Eigen::MatrixXd &data, FIFFLIB::FiffInfo &info, const QStringList &chNames) |
| Add reference channel(s) back as zero-filled rows. | |
| DSPSHARED_EXPORT void | setBipolarReference (Eigen::MatrixXd &data, FIFFLIB::FiffInfo &info, const QStringList &anodes, const QStringList &cathodes, bool dropOriginals=true) |
| Create bipolar derivations from EEG channels. | |
| DSPSHARED_EXPORT void | filterChpi (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, double sfreq, const QVector< double > &hpiFreqs, const FilterChpiParams ¶ms=FilterChpiParams()) |
| Remove cHPI excitation signals from MEG data by notch filtering. | |
| DSPSHARED_EXPORT void | filterChpi (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, double sfreq, const FilterChpiParams ¶ms=FilterChpiParams()) |
| Overload that attempts to extract cHPI frequencies from FiffInfo. | |
| DSPSHARED_EXPORT QList< QPair< int, double > > | peakFinder (const Eigen::VectorXd &data, const PeakFinderParams ¶ms=PeakFinderParams()) |
| Find peaks in a 1D signal. | |
| DSPSHARED_EXPORT Eigen::VectorXd | peakProminences (const Eigen::VectorXd &data, const QList< int > &peakIndices) |
| Compute prominence of each peak. | |
| DSPSHARED_EXPORT INVLIB::InvSourceEstimate | simulateStc (const Eigen::VectorXi &activeVertices, const Eigen::VectorXi &allVertices, const SimulateStcParams ¶ms=SimulateStcParams()) |
| Create a synthetic source time course. | |
| DSPSHARED_EXPORT INVLIB::InvSourceEstimate | simulateStcFromWaveforms (const Eigen::MatrixXd &waveforms, const Eigen::VectorXi &activeVertices, const Eigen::VectorXi &allVertices, float tmin=0.0f, float tstep=0.001f) |
| Create a synthetic source time course from custom waveforms. | |
| DSPSHARED_EXPORT FIFFLIB::FiffEvoked | simulateEvoked (const MNELIB::MNEForwardSolution &fwd, const INVLIB::InvSourceEstimate &stc, const FIFFLIB::FiffInfo &info, const FIFFLIB::FiffCov &noiseCov, int nave=1, int seed=42) |
| Simulate evoked data from a source estimate and forward model. | |
| DSPSHARED_EXPORT FIFFLIB::FiffEvoked | simulateEvokedNoiseless (const MNELIB::MNEForwardSolution &fwd, const INVLIB::InvSourceEstimate &stc, const FIFFLIB::FiffInfo &info) |
| Simulate evoked data without noise. | |
| DSPSHARED_EXPORT Eigen::MatrixXd | makeSpharaProjector (const Eigen::MatrixXd &matBaseFct, const Eigen::VectorXi &vecIndices, int iOperatorDim, int iNBaseFct, int iSkip=0) |
| DSPSHARED_EXPORT void | fixStimArtifact (Eigen::MatrixXd &data, const Eigen::MatrixXi &events, double sfreq, int eventId=-1, double tmin=0.0, double tmax=0.01, StimArtifactMode mode=StimArtifactMode::Linear) |
| Repair stimulus artifacts by interpolating or zeroing data around events. | |
| constexpr auto | timeNowNow () |
| constexpr auto | dateToday () |
| constexpr auto | dateTimeNow () |
| constexpr auto | gitHash () |
| constexpr auto | gitHashLong () |
| const char * | buildDateTime () |
| const char * | buildHash () |
| const char * | buildHashLong () |
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
| typedef CircularBuffer<char> UTILSLIB::CircularBuffer_char |
Defines CircularBuffer of char type.
Definition at line 296 of file circularbuffer.h.
| typedef CircularBuffer<double> UTILSLIB::CircularBuffer_double |
Defines CircularBuffer of double type.
Definition at line 297 of file circularbuffer.h.
| typedef CircularBuffer<int> UTILSLIB::CircularBuffer_int |
Defines CircularBuffer of integer type.
Definition at line 294 of file circularbuffer.h.
| typedef CircularBuffer< Eigen::MatrixXd > UTILSLIB::CircularBuffer_Matrix_double |
Defines CircularBuffer of Eigen::MatrixXd type.
Definition at line 300 of file circularbuffer.h.
| typedef CircularBuffer< Eigen::MatrixXf > UTILSLIB::CircularBuffer_Matrix_float |
Defines CircularBuffer of Eigen::MatrixXf type.
Definition at line 301 of file circularbuffer.h.
| typedef CircularBuffer< QPair<double, double> > UTILSLIB::CircularBuffer_pair_double_double |
Defines CircularBuffer of double Pair type.
Definition at line 299 of file circularbuffer.h.
| typedef CircularBuffer< QPair<int, int> > UTILSLIB::CircularBuffer_pair_int_int |
Defines CircularBuffer of integer Pair type.
Definition at line 298 of file circularbuffer.h.
| typedef CircularBuffer<short> UTILSLIB::CircularBuffer_short |
Defines CircularBuffer of short type.
Definition at line 295 of file circularbuffer.h.
| using UTILSLIB::fitUser = fitUserRec* |
Definition at line 77 of file layoutmaker.h.
| using UTILSLIB::PythonLineCallback = std::function<void(int channel, const QString& line)> |
Line-level callback signature.
| channel | 0 = stdout, 1 = stderr. |
| line | The text line (without trailing newline). |
Definition at line 96 of file python_runner.h.
| using UTILSLIB::PythonProgressCallback = std::function<void(float pct, const QString& msg)> |
Progress callback signature.
| pct | Progress percentage 0.0 – 100.0. |
| msg | Optional message accompanying the progress update. |
Definition at line 105 of file python_runner.h.
|
strong |
Identifier for the three cardinal fiducials.
Numerically aligned with the FIFF ident field used for cardinal points (1 = LPA, 2 = NAS, 3 = RPA).
| Enumerator | |
|---|---|
| LPA | |
| NAS | |
| RPA | |
Definition at line 64 of file acquired_points.h.
|
strong |
|
strong |
|
strong |
|
strong |
Logical category of a captured point.
Maps onto the FIFF point-kind constants on export (FIFFV_POINT_CARDINAL / FIFFV_POINT_EEG / FIFFV_POINT_EXTRA).
| Enumerator | |
|---|---|
| Fiducial | Anatomical landmark (NAS / LPA / RPA). |
| Eeg | Named EEG electrode contact. |
| HeadShape | Free head-shape point (continuous mode). |
Definition at line 51 of file acquired_points.h.
|
strong |
Mode for stimulus artifact repair.
| Enumerator | |
|---|---|
| Linear | Linear interpolation across the artifact window. |
| Window | Zero-pad (set to zero) the artifact window. |
Definition at line 42 of file stim_artifact.h.
| DSPSHARED_EXPORT void UTILSLIB::addReferenceChannels | ( | Eigen::MatrixXd & | data, |
| FIFFLIB::FiffInfo & | info, | ||
| const QStringList & | chNames ) |
Add reference channel(s) back as zero-filled rows.
When EEG data was recorded with a physical reference electrode, that channel is implicit (all zeros after re-referencing). This function adds it back explicitly so it can participate in average re-referencing or source localization.
| [in,out] | data | Data matrix. Rows are added at the end. |
| [in,out] | info | Measurement info. New EEG channels are appended. |
| [in] | chNames | Names of the reference channel(s) to add. |
| DSPSHARED_EXPORT FIFFLIB::FiffAnnotations UTILSLIB::annotateAmplitude | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| double | sfreq, | ||
| const AnnotateAmplitudeParams & | params = AnnotateAmplitudeParams() ) |
Annotate segments where amplitude exceeds thresholds or is too flat.
Scans each channel independently:
| [in] | data | Raw data matrix (n_channels × n_times). |
| [in] | info | Measurement info (for channel names). |
| [in] | sfreq | Sampling frequency in Hz. |
| [in] | params | Detection parameters. |
| DSPSHARED_EXPORT FIFFLIB::FiffAnnotations UTILSLIB::annotateMusclZscore | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| double | sfreq, | ||
| const AnnotateMusclParams & | params = AnnotateMusclParams() ) |
Detect muscle artifacts via high-frequency z-score and annotate bad segments.
Algorithm:
| [in] | data | Raw data matrix (n_channels × n_times). |
| [in] | info | Measurement info. |
| [in] | sfreq | Sampling frequency in Hz. |
| [in] | params | Detection parameters. |
| const char * UTILSLIB::buildDateTime | ( | ) |
Returns build date and time.
Definition at line 32 of file utils_global.cpp.
| const char * UTILSLIB::buildHash | ( | ) |
Returns abbreviated build git hash.
Definition at line 36 of file utils_global.cpp.
| const char * UTILSLIB::buildHashLong | ( | ) |
Returns full build git hash.
Definition at line 40 of file utils_global.cpp.
| DSPSHARED_EXPORT QList< QPair< int, int > > UTILSLIB::computeBridgedElectrodes | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| const BridgedElectrodeParams & | params = BridgedElectrodeParams() ) |
Detect bridged EEG electrodes.
Finds pairs of EEG channels whose electrical distance falls below the threshold, indicating a physical or gel bridge.
| [in] | data | Data matrix (n_channels x n_times). |
| [in] | info | FiffInfo with channel types. |
| [in] | params | Detection parameters. |
| DSPSHARED_EXPORT Eigen::MatrixXd UTILSLIB::computeElectricalDistance | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info ) |
Compute electrical distance matrix between EEG channels.
Electrical distance is defined as the standard deviation of the difference signal between two channels, normalised by the geometric mean of their individual standard deviations. Bridged electrodes will have near-zero electrical distance.
| [in] | data | Data matrix (n_channels x n_times). |
| [in] | info | FiffInfo with channel types. |
| DSPSHARED_EXPORT Eigen::VectorXd UTILSLIB::computeLofScores | ( | const Eigen::MatrixXd & | features, |
| int | k ) |
Compute LOF scores for a feature matrix.
Pure algorithmic LOF implementation operating on feature vectors.
| [in] | features | Feature matrix (n_points x n_features). |
| [in] | k | Number of neighbours. |
|
constexpr |
Returns build date and time (time preprocessor was run). Must be called in compiled function to return correctly.
Definition at line 61 of file buildinfo.h.
|
constexpr |
Returns build date (time preprocessor was run). Must be called in compiled function to return correctly.
Definition at line 51 of file buildinfo.h.
| DSPSHARED_EXPORT void UTILSLIB::filterChpi | ( | Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| double | sfreq, | ||
| const FilterChpiParams & | params = FilterChpiParams() ) |
Overload that attempts to extract cHPI frequencies from FiffInfo.
Tries to read HPI coil frequencies from the FiffInfo metadata. Because the FiffInfo HPI frequency storage varies across file versions, this overload may not always succeed. If frequencies cannot be determined, a warning is logged and no filtering is applied. In that case, use the explicit-frequency overload instead.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | info | Measurement info. |
| [in] | sfreq | Sampling frequency in Hz. |
| [in] | params | Filtering parameters. |
| DSPSHARED_EXPORT void UTILSLIB::filterChpi | ( | Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| double | sfreq, | ||
| const QVector< double > & | hpiFreqs, | ||
| const FilterChpiParams & | params = FilterChpiParams() ) |
Remove cHPI excitation signals from MEG data by notch filtering.
Applies a zero-phase Butterworth band-stop (notch) filter at each specified cHPI frequency. Only MEG channels are filtered by default.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | info | Measurement info (used to identify MEG channels if bMegOnly is true). |
| [in] | sfreq | Sampling frequency in Hz. |
| [in] | hpiFreqs | List of cHPI excitation frequencies in Hz. Typical Elekta/MEGIN system: {83, 143, 203, 263, 293}. |
| [in] | params | Filtering parameters. |
| DSPSHARED_EXPORT QStringList UTILSLIB::findBadChannelsLof | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| const LofBadChannelParams & | params = LofBadChannelParams() ) |
Detect bad channels using Local Outlier Factor (LOF).
Computes features for each channel (standard deviation, kurtosis, max absolute amplitude) and applies the LOF algorithm to identify outlier channels. LOF compares the local density of a point's neighbourhood to the densities of its neighbours.
| [in] | data | Data matrix (n_channels x n_times). |
| [in] | info | FiffInfo with channel types. |
| [in] | params | LOF parameters. |
| DSPSHARED_EXPORT BadChannelsMaxwellResult UTILSLIB::findBadChannelsMaxwell | ( | const Eigen::MatrixXd & | matData, |
| const FIFFLIB::FiffInfo & | info, | ||
| const BadChannelsMaxwellParams & | params = BadChannelsMaxwellParams() ) |
Detect bad MEG channels using SSS reconstruction residuals.
Computes the SSS reconstruction of the data, then flags channels whose residual (difference between original and reconstructed) is anomalously large relative to the population of channels.
| [in] | matData | MEG data (n_channels x n_times). Should include all channels (MEG and non-MEG). |
| [in] | info | Measurement info with channel positions. |
| [in] | params | Detection parameters. |
| DSPSHARED_EXPORT void UTILSLIB::fixStimArtifact | ( | Eigen::MatrixXd & | data, |
| const Eigen::MatrixXi & | events, | ||
| double | sfreq, | ||
| int | eventId = -1, | ||
| double | tmin = 0.0, | ||
| double | tmax = 0.01, | ||
| StimArtifactMode | mode = StimArtifactMode::Linear ) |
Repair stimulus artifacts by interpolating or zeroing data around events.
For each event sample, the data in the window [event + tmin_samples, event + tmax_samples] is either linearly interpolated from the boundary values or set to zero.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | events | Event matrix (Nx3: [sample, before, after]). Only the sample column (col 0) is used to locate artifact windows. |
| [in] | sfreq | Sampling frequency in Hz. |
| [in] | eventId | If >= 0, only process events where column 2 (after) matches this value. If < 0, process all events. Default: -1. |
| [in] | tmin | Start of artifact window in seconds relative to event (negative = before event). Default: 0.0 (event onset). |
| [in] | tmax | End of artifact window in seconds relative to event. Default: 0.01 (10 ms after event). |
| [in] | mode | Repair mode (Linear interpolation or zero-padding). Default: StimArtifactMode::Linear. |
|
constexpr |
Returns short version of the hash of the current git commit
Definition at line 70 of file buildinfo.h.
|
constexpr |
Returns entire hash of the current git commit
Definition at line 83 of file buildinfo.h.
| DSPSHARED_EXPORT Eigen::MatrixXd UTILSLIB::makeSpharaProjector | ( | const Eigen::MatrixXd & | matBaseFct, |
| const Eigen::VectorXi & | vecIndices, | ||
| int | iOperatorDim, | ||
| int | iNBaseFct, | ||
| int | iSkip = 0 ) |
Constructs a SPHARA operator.
| [in] | matBaseFct | The SPHARA basis functions. |
| [in] | vecIndices | The indices of the positions in the final oeprator which are to be filled with the basis functions weights (i.e. these indices could respond to the indices of gradioemteres in a VectorView system). |
| [in] | iOperatorDim | The dimensions of the final SPHARA operator. Make sure that these correspond to the dimensions of the data matrix you want tol multiply with the SPHARA operator. |
| [in] | iNBaseFct | The number of SPHARA basis functions to take. |
| [in] | iSkip | The value to skip when reading the vecIndices variabel. I.e. use this when dealing with VectorView triplets, which include two gradiometers. |
| DSPSHARED_EXPORT QList< QPair< int, double > > UTILSLIB::peakFinder | ( | const Eigen::VectorXd & | data, |
| const PeakFinderParams & | params = PeakFinderParams() ) |
Find peaks in a 1D signal.
A peak is a sample that is strictly greater than both its neighbours. Additional filtering by height, distance, and prominence can be applied.
| [in] | data | 1D signal (row vector or VectorXd). |
| [in] | params | Peak detection parameters. |
| DSPSHARED_EXPORT Eigen::VectorXd UTILSLIB::peakProminences | ( | const Eigen::VectorXd & | data, |
| const QList< int > & | peakIndices ) |
Compute prominence of each peak.
Prominence is the vertical distance from a peak to the highest valley on either side before reaching a higher peak.
| [in] | data | 1D signal. |
| [in] | peakIndices | Indices of detected peaks. |
| DSPSHARED_EXPORT void UTILSLIB::setBipolarReference | ( | Eigen::MatrixXd & | data, |
| FIFFLIB::FiffInfo & | info, | ||
| const QStringList & | anodes, | ||
| const QStringList & | cathodes, | ||
| bool | dropOriginals = true ) |
Create bipolar derivations from EEG channels.
Creates new bipolar channels by subtracting cathode from anode for each pair. The original channels are replaced with the bipolar derivations.
| [in,out] | data | Data matrix. Replaced with bipolar derivation rows. |
| [in,out] | info | Measurement info. Updated with new bipolar channel info. |
| [in] | anodes | List of anode channel names. |
| [in] | cathodes | List of cathode channel names (same length as anodes). |
| [in] | dropOriginals | If true, remove the original anode/cathode channels from the output (default: true). |
| DSPSHARED_EXPORT void UTILSLIB::setEegReference | ( | Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| const QStringList & | refChannels = QStringList(), | ||
| bool | projection = false ) |
Re-reference EEG channels to average, specific channel(s), or REST.
Only modifies rows corresponding to EEG channels (kind == FIFFV_EEG_CH). Non-EEG channels are left untouched.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | info | Measurement info (used to identify EEG channels). |
| [in] | refChannels | Reference channel name(s).
|
| [in] | projection | If true, add an SSP projector for average reference instead of modifying data. (default: false — modify data directly) |
| FiffEvoked UTILSLIB::simulateEvoked | ( | const MNELIB::MNEForwardSolution & | fwd, |
| const INVLIB::InvSourceEstimate & | stc, | ||
| const FIFFLIB::FiffInfo & | info, | ||
| const FIFFLIB::FiffCov & | noiseCov, | ||
| int | nave = 1, | ||
| int | seed = 42 ) |
Simulate evoked data from a source estimate and forward model.
Projects the source estimate through the forward model to generate sensor-space data, optionally adding noise from a noise covariance.
Equivalent to MNE-Python's mne.simulation.simulate_evoked().
| [in] | fwd | Forward solution (gain matrix). |
| [in] | stc | Source time course. |
| [in] | info | Measurement info (for output channel info). |
| [in] | noiseCov | Noise covariance for additive noise (optional). |
| [in] | nave | Number of averages (noise scaled by 1/sqrt(nave)). |
| [in] | seed | Random seed for noise generation. |
Definition at line 146 of file simulate.cpp.
| FiffEvoked UTILSLIB::simulateEvokedNoiseless | ( | const MNELIB::MNEForwardSolution & | fwd, |
| const INVLIB::InvSourceEstimate & | stc, | ||
| const FIFFLIB::FiffInfo & | info ) |
Simulate evoked data without noise.
Projects source estimate through forward model (no noise added).
| [in] | fwd | Forward solution. |
| [in] | stc | Source time course. |
| [in] | info | Measurement info. |
Definition at line 197 of file simulate.cpp.
| DSPSHARED_EXPORT INVLIB::InvSourceEstimate UTILSLIB::simulateStc | ( | const Eigen::VectorXi & | activeVertices, |
| const Eigen::VectorXi & | allVertices, | ||
| const SimulateStcParams & | params = SimulateStcParams() ) |
Create a synthetic source time course.
Generates an InvSourceEstimate with Gaussian-envelope waveforms at specified source vertices. Each active source has a Gaussian temporal profile centered at different times.
| [in] | activeVertices | Vertex indices for active sources. |
| [in] | allVertices | Full vertex index vector for the source space. |
| [in] | params | Simulation parameters (sfreq, tmin, duration). |
| DSPSHARED_EXPORT INVLIB::InvSourceEstimate UTILSLIB::simulateStcFromWaveforms | ( | const Eigen::MatrixXd & | waveforms, |
| const Eigen::VectorXi & | activeVertices, | ||
| const Eigen::VectorXi & | allVertices, | ||
| float | tmin = 0.0f, | ||
| float | tstep = 0.001f ) |
Create a synthetic source time course from custom waveforms.
| [in] | waveforms | Waveform data (n_active_sources x n_times). |
| [in] | activeVertices | Vertex indices for the active sources. |
| [in] | allVertices | Full vertex index vector. |
| [in] | tmin | Start time (s). |
| [in] | tstep | Time step (s). |
|
constexpr |
Returns build time (time preprocessor was run). Must be called in compiled function to return correctly.
Definition at line 42 of file buildinfo.h.