-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the new feature or enhancement
Modify the Maxwell Filtering process to include an option for multi-origin SSS calculation, dubbed the mSSS method, following the implementation and investigation in "Refinined SSS models for on-scalp MEG" McPherson et al. 2025. First, we propose a new function fit_spheres_to_mri
based on @larsoner 's code for the manuscript that optimizes multiple origins for the mSSS basis. Then, we propose a modification/addition to the function maxwell_filter
to take in the multiple origins to calculate the mSSS basis.
Describe your proposed implementation
-
For the first step of calculating the optimized centers, I talked with @larsoner and we converged on an API like:
def fit_spheres_to_mri(bem, trans, n_spheres=2): ... return spheres # ndarray, shape (n_spheres, 3)
We have the code to implement this part, modified from the code written for the mSSS method paper modified to fit the proposed API. This code would include a warning that only the two-sphere case has been tested and investigated, we can allow the user to generate 3 centers, but could raise an error if any more are asked for. -
Next, to use the optimized spheres to calculate two different internal SSS basis sets, we propose modifying the 'maxwell_filter' to this API that takes in an array-like object of shape (n_spheres, 3):
raw_sss = maxwell_filter(raw, ..., origin=((0., 0., 0.03), (0., 0.05, 0.02)), ...
The internal change inmaxwell_filter
would be to make a new function called_sss_multi
, like the function_sss_basic(exp,all_coils)
, which takes the multiple origins and combines two interior basis sets using SVD. I have the code to do this calculation based on the implementation discussed in the paper
Describe possible alternatives
- The optimization of the centers has been tested/implemented by @larsoner and myself, and already functioned well for the purposes of the initial mSSS investigation. We suggested separating this step from the actually SSS calculations so that users could use any centers, not necessarily the optimized ones, in the mSSS calculation step if they wish.
- inside
maxwell_filter
, instead of making a new function, we could modify the existing_sss_basic
function to take in an extra parameter pertaining to the multiple sensors. But, It would be clearer to create a new function as suggested previously to deal with the multi-SSS case, as two interior basis sets must be calculated, processed with SVD, and then combined with the typical exterior basis to form the mSSS method.
Additional context
The mSSS method specifically pertains to on-scalp MEG systems, like OPMs, where traditional SSS may fail.