[FieldTrip] source localization only at the edges
Tyler Grummett
tyler.grummett at flinders.edu.au
Thu Feb 26 00:40:29 CET 2015
Hello :)
I've come across this issue myself a while back and for me it was because there were dipoles located outside the brain, but the code was telling me they were inside.
Could this be happening to you?
Tyler
Sent from my iPhone
> On 25 Feb 2015, at 1:06 am, 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
> <03 PM.jpg>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
More information about the fieldtrip
mailing list