[FieldTrip] GrandAVG and Stats can't be plottet on anatomy or be interpolated on an MRI

Martin Winkels m_wink10 at uni-muenster.de
Fri Jun 29 14:09:47 CEST 2012


Hello,

I got a kind of big problem as follows.

*I can easly normalize, interpolate and plot my LCMV-Beamformer results on
an MRI and plot with that anatomy:*

template = '/media/sonja1/MatlabAnalysis/
Martin/WFU_PickAtlas/spm8/canonical/single_subj_T1.nii';

template_mri = ft_read_mri(template);

cfg = [];
% cfg.coordsys = 'spm';
cfg.method = 'fiducial'; %'interactive';
cfg.fiducial.nas  =  [45 106 17]; %position of nasion
cfg.fiducial.lpa  = [88 49 11]; %position of LPA
cfg.fiducial.rpa  = [3 49 11]; %position of RPA
mri = ft_volumerealign(cfg, template_mri);

load(sourcesOutFile);

cfg            = [];
cfg.downsample = 1;
cfg.parameter = {'avg.pow', 'avg.logpowDiff'};

sourceDiffInt  = ft_sourceinterpolate(cfg, sourceDiff , mri);


Works without any problem! And can be plotted afterwords kind of nicely on
an anatomy.

*
Now what doesn't work:*

%Load functional data
load(['/media/sonja1/Patienten/Parkinson/grandAVG_SourceDiff_OHNEdysphagie__beta.mat']);

%avg.avg.pow to avg.pow
powtemp = grandavg.avg.avg.pow;
grandavg = rmfield(grandavg, 'avg');
grandavg.avg.pow = powtemp;

%Load template MRI
template =
'/media/sonja1/MatlabAnalysis/Martin/WFU_PickAtlas/spm8/canonical/single_subj_T1.nii';
template_mri = ft_read_mri(template);

%Segment and Interpolate MRI
cfg = [];
cfg.method = 'fiducial'; %'interactive';
cfg.fiducial.nas  =  [45 106 17]; %position of nasion
cfg.fiducial.lpa  = [88 49 11]; %position of LPA
cfg.fiducial.rpa  = [3 49 11]; %position of RPA
mri_realign = ft_volumerealign(cfg, template_mri);

% match up volumetric source result matrix with anatomical volume
cfg            = [];
cfg.downsample = 1;
cfg.parameter     = 'avg.pow';
sourceDiff_int  = ft_sourceinterpolate(cfg, grandavg , mri_realign);

%Plot MRI
cfg = [];
cfg.method        = 'ortho';
cfg.interactive   = 'yes';
cfg.funparameter  = 'avg.pow';

figure; ft_sourceplot(cfg, grandavg);


- it starts to interpolate over hours and hours... and the results are
worng at the end.


*I tried also this way (this worked with another experiment where we got
individual MRI's for each subject):*

%load GAVG-Results
load(['/media/sonja1/Patienten/Parkinson/grandAVG_SourceDiff_OHNEdysphagie__beta.mat']);

%Remove the avg.avg field
powtemp = grandavg.avg.avg.pow;
grandavg = rmfield(grandavg, 'avg');
grandavg.avg.pow = powtemp;

%Load an anatomy from the normalized subjects which have been interpolated
load(['/media/sonja1/Patienten/Parkinson/P0390/P0390-vol-f.ds/sourceDiffNormalized.mat']);

%Plot with anatomy from normalized subject
cfg = [];
cfg.method        = 'ortho';
cfg.interactive   = 'yes';
cfg.funparameter  = 'avg.pow';
grandavg.anatomy = sourceDiffIntNorm_beta.anatomy;

figure; ft_sourceplot(cfg, grandavg);


That prints the following error:

??? Attempted to access dim(3); index out of bounds because numel(dim)=2.

Error in ==> ft_plot_slice at 207
  if all(ori==[0 1 0]), xplane = 1:dim(1); yplane = loc(2); zplane =
1:dim(3);   end

Error in ==> ft_plot_ortho at 119
      hx = ft_plot_slice(dat, varargin{:});

Error in ==> ft_sourceplot at 781
      ft_plot_ortho(ana, 'transform', eye(4), 'location', ijk, 'style',
'subplot', 'parents', [h1 h2
      h3].*update, 'doscale', false);

Error in ==> mw_ft_plot_GrandAVGa at 19
figure; ft_sourceplot(cfg, grandavg);

I also upladed the data here:

http://www.sendspace.com/file/zkbgqz

Does anybody have any suggestions?

(I send this to the Email-System and the Bug-System maybe I'm just doing
something wrong and somebody faced the same problem some time ago)

Thanks,

Martin Winkels
Universität Münster
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120629/220e2f6c/attachment-0001.html>


More information about the fieldtrip mailing list