v2.0.0
Loading...
Searching...
No Matches
inv_source_estimate_token.cpp File Reference

Implementation of the INVLIB::tokenize / INVLIB::fromTokens free functions. More...

#include "inv_source_estimate_token.h"
#include "inv_source_estimate.h"
#include <algorithm>
#include <cmath>
Include dependency graph for inv_source_estimate_token.cpp:

Go to the source code of this file.

Namespaces

namespace  INVLIB
 Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting).

Functions

std::vector< InvTokenINVLIB::tokenize (const InvSourceEstimate &estimate, const InvTokenizeOptions &options=InvTokenizeOptions())
 Serialise an InvSourceEstimate into a flat token sequence.
InvSourceEstimate INVLIB::fromTokens (const std::vector< InvToken > &tokens)
 Reconstruct an InvSourceEstimate from a token sequence.

Detailed Description

Implementation of the INVLIB::tokenize / INVLIB::fromTokens free functions.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

Walks the InvSourceEstimate in canonical order — metadata, positions, dense grid, coupling groups, focal dipoles, connectivity layers — emitting structural tokens around each section so the parser can re-section the stream without look-ahead. Continuous values (amplitudes, positions, times, correlations) are paired with their InvTokenId in the value field of InvToken; structural tokens leave it at zero. The inverse path is a single-pass state machine that rebuilds each layer as its *Begin / *End brackets are consumed.

Definition in file inv_source_estimate_token.cpp.