[FieldTrip] source localization only at the edges
Saurabh Kumar
kumar at cbs.mpg.de
Tue Feb 24 15:33:15 CET 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03 PM.jpg
Type: image/jpeg
Size: 228015 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150224/79c8060a/attachment-0001.jpg>
More information about the fieldtrip
mailing list