AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip.
r.oostenveld at FCDONDERS.RU.NL
Wed Jul 8 10:09:08 CEST 2009
I have tried importing another MRI fif file which I still had on disk
using the following modification of the fieldtrip/fileio/read_mri.m code
elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne')
% use the mne functions to read the Neuromag MRI
hdr = fiff_read_mri(filename);
img = cat(3, hdr.slices.data);
hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data
to save memory
transform = hdr.trans.trans;
and then slightly further down in the code
% set up the axes of the volume in voxel coordinates
nx = size(img,1);
ny = size(img,2);
nz = size(img,3);
mri.dim = [nx ny nz];
% store the anatomical data
mri.anatomy = img;
% store the header with all fileformat specific details
mri.hdr = hdr;
% if present, store the homogenous transformation matrix
mri.transform = transform;
This results in a warning of the MNE fiff_read_mri function
>> mri = read_mri('lp_mri_headcoords.fif')
Reading slice information and pixel data..50..100..126..[done]
The slices are not equally spaced. Voxel transformation will not be
dim: [256 256 126]
anatomy: [256x256x126 int16]
hdr: [1x1 struct]
transform: [4x4 double]
and the resulting coordinate transformation matrix is not fully
correct. You can check the coordinates by plotting it intreactively in
sourceplot (after converting the image data from int16 into double).
Perhaps one of the Neuromag experts on the list can help you further.
PS atatched is the latest read_mri function, which includes the call
On 8 Jul 2009, at 9:49, Robert Oostenveld wrote:
> Hi Hanneke,
> The mri.fif file that you sent only contains the header information,
> but not the slice/image information.
> >> fiff_read_mri('mri.fif')
> Reading slice information and pixel data.??? Error using ==>
> fiff_read_mri at 116
> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/
> Please also send the corresponding slice data.
> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote:
>> Hi Robert,
>> Thanks for your reply. I have tried the meg_pd function loadmri
>> (via read_mri in fieldtrip) but I got the feedback: 'error loading
>> mri-file'. So I have no idea what is going wrong. I will send you
>> the example mri-file right now. It is probably not to difficult to
>> work something out but I want to be sure that the mri head
>> coordinates end up in the right way as device coordinates.
>> Thanks in advance!
>> Viele Gruße aus Düsseldorf ;-)
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html
> and http://www.ru.nl/neuroimaging/fieldtrip.
The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11399 bytes
Desc: not available
More information about the fieldtrip