Tokeniser and de-tokeniser that turn an INVLIB::InvSourceEstimate into a flat sequence consumable by foundation-model architectures. More...


Go to the source code of this file.
Namespaces | |
| namespace | INVLIB |
| Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting). | |
Functions | |
| std::vector< InvToken > | INVLIB::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. | |
Tokeniser and de-tokeniser that turn an INVLIB::InvSourceEstimate into a flat sequence consumable by foundation-model architectures.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Declares the free functions INVLIB::tokenize and INVLIB::fromTokens that round-trip an InvSourceEstimate through the InvToken vocabulary defined in inv_token.h. The tokeniser walks the estimate's metadata, dense grid, vertex list, focal dipoles, coupling groups and connectivity layers and emits a self-describing sequence framed by BOS / EOS markers. The InvTokenizeOptions struct enables sub-sampling or layer omission for context-limited transformer windows, while the inverse parser silently skips unknown tokens to keep the format forward-compatible.
Definition in file inv_source_estimate_token.h.