<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Meike,<div><br></div><div>I'm not sure if this relates to your problem, but I had - possibly similar - issues with the warped grid and the template being 90° rotated.</div><div>My problem was due to an error during the realignment of the MRI.</div><div>Did you check whether the realignment works and whether your different coordinate systems make sense?</div><div><br></div><div>Could you also maybe attach a picture of your exchanged axes? At least for me it's hard to image how this looks.</div><div><br></div><div>Best,</div><div><br></div><div>Julian</div><div><br></div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; ">********************</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b>Dr. Julian Keil</b></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b><br></b></div>AG Multisensorische Integration<br>Psychiatrische Universitätsklinik<br>der Charité im St. Hedwig-Krankenhaus<br>Große Hamburger Straße 5-11, Raum E 307<br>10115 Berlin</div><div><br>Telefon: +49-30-2311-1879<br>Fax: +49-30-2311-2209 </div><div><a href="http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration">http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration</a></div></span>
</div>
<br><div><div>Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">
<div class="" lang="x-western">
<div class="" style="font-family:-moz-fixed;font-size:14px" lang="x-western">Dear Fieldtrippers!
<br>
As newbie I have another question, now concerning the warping from
MNI to individual subjects.
<br>
Using the below code (the first part almost entirely from <a class="" href="http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space">http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space</a>),
I get first the template and then apply the grid to the individual
subjects.
<br>
However, in later on analysis step it turned out that while the
subjects where nicely similar positioned, the template position is
entirely different, as it is was even axes were exchanged...
<br>
Does anybody know what could be the reason and how to change it?
<br>
Thanks for any suggestions!
<br>
Best, Meike
<br>
<br>
<br>
% NOTE: the path to the template file is user-specific
<br>
template =
ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii');<br>
template.coordsys = 'spm'; % so that FieldTrip knows how to
interpret the coordinate system
<br>
<br>
% segment the template brain and construct a volume conduction
model (i.e. head model): this is needed
<br>
% for the inside/outside detection of voxels.
<br>
cfg = [];
<br>
template_seg = ft_volumesegment(cfg, template);
<br>
<br>
cfg = [];
<br>
cfg.method = 'singleshell';
<br>
template_vol = ft_prepare_headmodel(cfg, template_seg);
<br>
template_vol = ft_convert_units(template_vol, 'cm'); % Convert the
vol to cm, since the grid will also be expressed in cm
<br>
<br>
% construct the dipole grid in the template brain coordinates
<br>
% the source units are in cm
<br>
% the negative inwardshift means an outward shift of the brain
surface for inside/outside detection
<br>
cfg = [];
<br>
cfg.grid.xgrid = -20:1:20;
<br>
cfg.grid.ygrid = -20:1:20;
<br>
cfg.grid.zgrid = -20:1:20;
<br>
cfg.grid.unit = 'cm';
<br>
cfg.grid.tight = 'yes';
<br>
cfg.inwardshift = -1.5;
<br>
cfg.vol = template_vol;
<br>
template_grid = ft_prepare_sourcemodel(cfg);
<br>
save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template')
<br>
% make a figure with the template head model and dipole grid
<br>
figure
<br>
hold on
<br>
ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor',
'none');alpha 0.5; camlight;
<br>
ft_plot_mesh(template_grid.pos(template_grid.inside,:));
<br>
else
load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template')<br>
<br>
<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<br>
SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06'
'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14'
'VP15' 'VP16' 'VP17' 'VP18'}
<br>
<br>
for SUBJI=SUBJECTS
<br>
SUBJ=SUBJI{1};
<br>
% read the single subject anatomical MRI
<br>
load(['..<i class=""><span class="">/</span>analysis/MEG/source_analysis<span class="">/</span></i>',SUBJ,'/mri']); %Has been
processed to CFT coordinates before
<br>
load(['..<i class=""><span class="">/</span>analysis/MEG/source_analysis<span class="">/</span></i>',SUBJ,'/segmentedmri']);
<br>
<br>
<br>
cfg = [];
<br>
cfg.method = 'singleshell';
<br>
vol = ft_prepare_headmodel(cfg, segmentedmri);
<br>
<br>
% create the subject specific grid, using the template grid that
has just been created
<br>
cfg = [];
<br>
cfg.grid.warpmni = 'yes';
<br>
cfg.grid.template = template_grid;
<br>
cfg.grid.nonlinear = 'yes'; % use non-linear normalization
<br>
cfg.mri = mri_ra;
<br>
grid = ft_prepare_sourcemodel(cfg);
<br>
<br>
% make a figure of the single subject headmodel, and grid
positions
<br>
figure;
<br>
ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight
<br>
ft_plot_mesh(grid.pos(grid.inside,:));
<br>
<br>
save(['..<i class=""><span class="">/</span>analysis/MEG/source_analysis<span class="">/</span></i>',SUBJ,'/MNIgrid'],'grid','vol')
<br>
end
<br>
<br>
</div>
</div>
</div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></div></body></html>