AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip.
Robert Oostenveld
r.oostenveld at FCDONDERS.RU.NL
Wed Jul 8 10:09:08 CEST 2009
Hi Hanneke,
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;
try
% if present, store the homogenous transformation matrix
mri.transform = transform;
end
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
included
mri =
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.
best regards,
Robert
PS atatched is the latest read_mri function, which includes the call
to fiff_read_mri.
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/
> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329
>
> Please also send the corresponding slice data.
>
> Robert
>
>
> 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 ;-)
>>
>> Hanneke
>
> ----------------------------------
> 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...
Name: read_mri.m
Type: application/octet-stream
Size: 11399 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20090708/f51749fc/attachment-0001.obj>
More information about the fieldtrip
mailing list