Skip to content

Using only the leadfield for source reconstruction #79

Description

@nguyen-td

Right now, we need a pointer to the head model and source model to run source reconstruction using pop_roi_activity. But technically, we only need a lead field, right?

Can we modify the the pop_roi_activity and roi_activity functions in a way that makes them accept the raw lead field matrix/array instead of requiring pointers? Say we have a pre-computed lead field with the dimension (30 x 5003 x 3), where 30 is the number of channels, 5003 the number of voxels and 3 the orientation and pass this array directly to the function, then we could skip almost all steps and jump right to this line:

leadfield = reshape(H*leadfield(:, :), nbchan, nvox, 3);

For example, you could download a standard lead field here (New York head) and just pass the lead field. So instead of having to run everything here (e.g. pipeline_connectivity)

EEG = pop_dipfit_settings( EEG, 'hdmfile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','standard_vol.mat'), ...
    'coordformat','MNI','mrifile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','standard_mri.mat'),...
    'chanfile',fullfile(eeglabp, 'plugins','dipfit','standard_BEM','elec', 'standard_1005.elc'),...
    'coord_transform',[0.83215 -15.6287 2.4114 0.081214 0.00093739 -1.5732 1.1742 1.0601 1.1485] );

EEG = pop_leadfield(EEG, 'sourcemodel',fullfile(eeglabp,'functions','supportfiles','head_modelColin27_5003_Standard-10-5-Cap339.mat'), ...
    'sourcemodel2mni',[0 -24 -45 0 0 -1.5708 1000 1000 1000] ,'downsample',1);

EEG = pop_roi_activity(EEG, 'leadfield',EEG.dipfit.sourcemodel,'model','LCMV','modelparams',{0.05},'atlas','LORETA-Talairach-BAs','nPCA',3, 'chansel', EEG.dipfit.chansel);

we could simply run something like this (of course, you would need to match the EEG channels):

load sa_nyhead

% use lower-resolution cortex
L_3D = sa.cortex75K.V_fem(:, sa.cortex5K.in_from_cortex75K, :);

EEG = pop_roi_activity(EEG, 'leadfield', L_3D,'model','LCMV','modelparams',{0.05},'atlas','LORETA-Talairach-BAs','nPCA',3);

I think this would make the code more flexible. What do you think @arnodelorme?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions