[FieldTrip] Extracting virtual EEG channel from a atlas based ROI

Gabriel Dippel dippel.g at gmail.com
Mon Aug 29 13:03:50 CEST 2016


Dear Julian,

thanks for your help!
With some minor changes it finally worked out with the following code:

vox1 = mri_cm.transform*[mri_cm.dim,1]'; % start
vox1 = vox1(1:3)*10; % convert to mm
vox2 = mri_cm.transform*[1,1,1,1]';   %end
vox2 = vox2(1:3)*10; % convert to mm

% Choose the Minima
vox_min = min([vox1,vox2]')';
vox_max = max([vox1,vox2]')';

% Set the spacing
vox_delta = abs(mri_cm.transform*[1,1,1,1]'-mri_cm.transform*[2,2,2,1]');
vox_delta = vox_delta(1:3)*10; % convert to mm
RES = vox_delta(1);

cfg = [];
%cfg.inwardshift = -0.5;
cfg.grid.xgrid = vox_min(1):RES:vox_max(1)+1;
cfg.grid.ygrid = vox_min(2):RES:vox_max(2)+1;
cfg.grid.zgrid = vox_min(3):RES:vox_max(3)+1;
cfg.grid.tight = 'no';
template_grid_mm = ft_prepare_sourcemodel(cfg, vol_mm);


Cheers
Gabriel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160829/5d1bbf48/attachment.html>


More information about the fieldtrip mailing list