<div dir="ltr"><div><div><div><div>Dear Julian!<br></div>Thanks for your help!<br></div>I guess it has been only a visualisation problem, it seems to be fine now!<br></div>Thanks anyway!<br></div>Meike<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-04-01 15:12 GMT+02:00 Julian Keil <span dir="ltr"><<a href="mailto:julian.keil@gmail.com" target="_blank">julian.keil@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">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 style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div>
<div style="word-wrap:break-word;font-size:12px">********************</div><div style="word-wrap:break-word"><b>Dr. Julian Keil</b></div><div style="word-wrap:break-word"><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: <a href="tel:%2B49-30-2311-1879" value="+493023111879" target="_blank">+49-30-2311-1879</a><br>
Fax:        <a href="tel:%2B49-30-2311-2209" value="+493023112209" target="_blank">+49-30-2311-2209</a> </div><div><a href="http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration" target="_blank">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><blockquote type="cite"><div><div class="h5"><div dir="ltr">
<div lang="x-western">
  

    
  
  
    <div 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 href="http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space" target="_blank">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><span>/</span>analysis/MEG/source_analysis<span>/</span></i>',SUBJ,'/mri']);  %Has been
      processed to CFT coordinates before
      <br>
      load(['..<i><span>/</span>analysis/MEG/source_analysis<span>/</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><span>/</span>analysis/MEG/source_analysis<span>/</span></i>',SUBJ,'/MNIgrid'],'grid','vol')
      <br>
      end
      <br>
      <br>
    </div>
  


</div>

</div></div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></blockquote>
</div><br></div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>