[FieldTrip] source localization only at the edges

Eelke Spaak eelke.spaak at donders.ru.nl
Tue Feb 24 15:41:30 CET 2015


Dear Saurabh,

Without having gone through the details of your code, my hunch is that
this has something to do with the units (m/cm/mm) of your geometrical
objects (electrode/gradiometer description, volume conduction model,
source model). You could explicitly convert them all to the same using
ft_convert_units([data.grad|vol|source], 'm') and then try again,
perhaps that helps?

Best,
Eelke

On 24 February 2015 at 15:33, Saurabh Kumar <kumar at cbs.mpg.de> wrote:
> Hello fieldtrippers,
>
> I have a question which I could not find has been answered.
> I am doing source localization for my data and the problem is that no matter the data, (even random numbers) the source always comes out at the edges of the mri. (Figure attached)
>
> I am using mne to localize the source.
> The code in short is attached below which I use. Please have a look and lemme know if you find something that can be changed.
>
> Code:
>
> %% load MRI data %%%%%%%%
> mri = ft_read_mri('Subject01.mri');
> % convert the coordinate system
> mri = ft_convert_coordsys(mri,'mni'); %% convert the coordinate system from the ctf into the mni
> mri.coordsys = 'mni';
>
>
> %% Volume segmentation %%%%%%%%
> cfg = [];
> cfg.output = {'brain','skull','scalp'};
> seg        = ft_volumesegment(cfg, mri); % it takes some time.
>
>
> %% creating the head model %%%%%%%%
> cfg        = [];
> cfg.method ='bemcp';
> vol        = ft_prepare_headmodel(cfg, seg);
>
>
> %% setting the electrodes (have checked the electrodes are in correct positions) %%%%%%%%
> %load elec_new
> cfg           = [];
> cfg.method    = 'interactive';
> cfg.elec      = elec_new;
> cfg.headshape = vol.bnd(3);
> elec_aligned  = ft_electroderealign(cfg);
>
> %% make grid %%%%%%%%
> cfg                 = [];
> cfg.vol             = vol;
> cfg.elec            = elec_aligned; % sa_new_elec; % elec_aligned;
> cfg.grid.resolution = 0.8; % a 3D grid with a part of cm resolution
> cfg.grid.unit       = 'cm';
> grid = ft_prepare_leadfield(cfg);
>
>
>
> % %%%%%%%% Check the full model %%%%%%%
> % grid.pos = grid.pos * 10;
> % elec_aligned.chanpos = elec_aligned.chanpos*100;
> % ft_plot_mesh(grid.pos(grid.inside,:));hold on;ft_plot_mesh(vol.bnd(1),'edgecolor','none', 'facealpha',0.5); hold on; ft_plot_sens(elec_aligned);
> % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
>
>
> %% source analysis %%%%%%%%
> cfg = [];
> cfg.method        = 'mne';
> cfg.vol           = vol;
> cfg.elec          = elec_aligned;  % elec_aligned; % sa_new_elec;
> cfg.grid          = grid;
> cfg.mne.lambda    = 3;
> cfg.mne.prewhiten = 'yes';
> cfg.mne.scalesourcecov = 'yes';
> source = ft_sourceanalysis(cfg,avg_data); % the data is in avg_data
>
> %% Interpolation of the localized source with the mri %%%%%%%%
> mri_reslice = ft_volumereslice([],mri);
> cfg=[];
> cfg.parameter  = 'pow';
> source_int = ft_sourceinterpolate(cfg, source, mri_reslice);
>
> %% Visualization (Orthogonal plot) %%%%%%%%
> cfg = [];
> cfg.method        = 'ortho';
> cfg.funparameter  = 'pow';
> cfg.funcolormap = 'jet';
> cfg.maskparameter = cfg.funparameter;
> ft_sourceplot(cfg, source_int_admit); % (figure attached)
>
>
>
>
> ----------------------------------------------------
> Thanks for your time,
> Saurabh Kumar
>
> Cognitive Neurology
> Max Planck Institute
> for Human Cognitive and Brain Sciences
> Stephanstr. 1a
> 04103 Leipzig



More information about the fieldtrip mailing list