[FieldTrip] help

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Apr 15 13:19:38 CEST 2024


Hi Sara,

The fact that the error still mentions: "converting from scanras to acpc is not supported” means that you did something not quite right.

The step that calls ft_volumerealign for the first time, i.e. using mri_orig as an input, and producing mri_realigned1 should return a structure (i.e. mri_realigned1) with a coordsys-field that is named ’neuromag’.
You seem to call ft_volumesegment with an anatomical volume that still has the underspecified (and unsupported) ’scanras’ as coordsys.

Best wishes,
Jan-Mathijs



On 15 Apr 2024, at 11:44, Sara Cinelli via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

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');
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Caee942dde10d4521798208dc5d3df053%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638487767795613871%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=CBvK2a58%2BwJl2LaY%2FNfy0cDRQgzGL4eQSL%2BLVx9r%2FT0%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240415/b4453e3a/attachment.htm>


More information about the fieldtrip mailing list