[FieldTrip] help

Sara Cinelli sara.cinelli at studenti.unipd.it
Mon Apr 15 11:44:11 CEST 2024


Hello,
I'm Sara Cinelli
I'm sorry for writing again, but I checked what you told me in the previous
email, but everything was already set the right way.
I have the same problem which I am reporting below together with the entire
code.
Thank you again, have a great day.

Regards,

Sara
% read and visualize the anatomical data
mrifile = './dicom/00000113.dcm';
mri_orig = ft_read_mri(mrifile);
% We also read the geometrical data from the fif file.
dataset = 'oddball1_mc_downsampled.fif';
grad = ft_read_sens(dataset, 'senstype', 'meg');% information about the MEG
magnetometer and gradiometer positions (the "grad” structure)
elec = ft_read_sens(dataset, 'senstype', 'eeg'); % about the EEG electrodes
(the "elec" structure)
shape = ft_read_headshape(dataset, 'unit', 'cm'); % information about the
head shape
%
% figure
% ft_plot_headshape(shape);
% %ft_plot_sens(grad, 'style', '*b');
% ft_plot_sens(elec, 'style', '*g');
% view([1 0 0])
% print -dpng natmeg_dip_geometry1.png
%visualize the anatomical MRI
figure
cfg = [];
ft_sourceplot(cfg, mri_orig);
save mri_orig mri_orig
%% Coregistration the anatomical MRI to MEG coordinate system
cfg = [];
cfg.method = 'interactive';
cfg.coordsys = 'neuromag';
[mri_realigned1] = ft_volumerealign(cfg, mri_orig);
save mri_realigned1 mri_realigned1
%
cfg = [];
cfg.method = 'headshape';
cfg.headshape = shape;
[mri_realigned2] = ft_volumerealign(cfg, mri_realigned1);
cfg = [];
cfg.resolution = 1;
cfg.xrange = [-100 100];
cfg.yrange = [-110 140];
cfg.zrange = [-80 120];
mri_resliced = ft_volumereslice(cfg, mri_realigned2);
save mri_resliced mri_resliced
% figure
% ft_sourceplot([], mri_resliced);
% print -dpng natmeg_dip_mri_resliced.png
% the low-level plotting functions do not know how to deal with units,
% so make sure we have the MRI expressed in cm as well
mri_resliced_cm = ft_convert_units(mri_resliced, 'cm');
save mri_resliced_cm mri_resliced_cm
%% Construct the MEG volume conduction model
% segmentazione
cfg = [];
cfg.output = {'brain', 'skull', 'scalp'};
mri_segmented = ft_volumesegment(cfg, mri_resliced);
% copy the anatomy into the segmented mri
mri_segmented.anatomy = mri_resliced.anatomy;
save mri_segmented mri_segmented


The error I have is the following:

Error using ft_affinecoordinates
converting from scanras to acpc is not supported

Error in ft_convert_coordsys (line 169)
  initial = ft_affinecoordinates(object.coordsys, target);

Error in ft_volumesegment (line 301)
    mri = ft_convert_coordsys(mri, 'acpc');
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240415/b6700fc9/attachment.htm>


More information about the fieldtrip mailing list