Software-gradiometer compensation wrapper that subtracts the reference-channel contribution from the primary forward field. More...


Go to the source code of this file.
Classes | |
| class | FWDLIB::FwdCompData |
CTF / 4D software-gradiometer wrapper that re-evaluates the primary field callback on a separate reference-coil set and subtracts the linear combination k·B_ref from the primary field to mirror the compensation already applied to the recorded data. More... | |
Namespaces | |
| namespace | MNELIB |
| Core MNE data structures (source spaces, source estimates, hemispheres). | |
| namespace | FWDLIB |
| Forward modelling — BEM solver, spherical models, sensor/coil definitions and the lead-field assembly that links current dipoles to MEG/EEG sensor readings. | |
Software-gradiometer compensation wrapper that subtracts the reference-channel contribution from the primary forward field.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2017-2026 MNE-CPP Authors
CTF whole-head and 4D/BTi MEG systems acquire a bank of reference channels located far from the head and form synthetic higher-order gradiometers by subtracting linear combinations of those references from each primary channel. The compensation coefficients k are stored in the FIFF file as a MNECTFCompDataSet. To keep the forward model consistent with the data, the same linear combination must be applied to the predicted field: B_comp = B_primary − k·B_reference.
FwdCompData wraps an underlying field/grad function pair (BEM or sphere), evaluates it once for the primary coils and once for the reference coils, and returns the compensated result. The class mirrors fwdCompDataRec from MNE-C fwd_comp_data.h and preserves the same callback signatures so it can be dropped into the source-space loop without changes upstream.
Definition in file fwd_comp_data.h.