<div dir="ltr">Dear Julian, <div><br></div><div>thanks for your help!</div><div>With some minor changes it finally worked out with the following code:</div><div><br></div><div><div>vox1 = mri_cm.transform*[mri_cm.dim,1]'; % start</div><div>vox1 = vox1(1:3)*10; % convert to mm</div><div>vox2 = mri_cm.transform*[1,1,1,1]';   %end</div><div>vox2 = vox2(1:3)*10; % convert to mm</div><div><br></div><div>% Choose the Minima</div><div>vox_min = min([vox1,vox2]')';</div><div>vox_max = max([vox1,vox2]')';</div><div><br></div><div>% Set the spacing</div><div>vox_delta = abs(mri_cm.transform*[1,1,1,1]'-mri_cm.transform*[2,2,2,1]'); </div><div>vox_delta = vox_delta(1:3)*10; % convert to mm</div><div>RES = vox_delta(1);</div><div><br></div><div>cfg = [];<br></div><div>%cfg.inwardshift = -0.5;</div><div>cfg.grid.xgrid = vox_min(1):RES:vox_max(1)+1; </div><div>cfg.grid.ygrid = vox_min(2):RES:vox_max(2)+1; </div><div>cfg.grid.zgrid = vox_min(3):RES:vox_max(3)+1; </div><div>cfg.grid.tight = 'no';</div><div>template_grid_mm = ft_prepare_sourcemodel(cfg, vol_mm);</div></div><div><br></div><div><br></div><div>Cheers </div><div>Gabriel</div></div>