AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip.

Gustavo Sudre gsudre at POBOX.COM
Wed Jul 8 14:34:35 CEST 2009


OK, so I just thought of two more questions, so I apologize for not  
including them in my previous e-mail...

1) If after importing the Neuromag MRI the (head) coordinate system of  
the mri structure matches the same coordinate system in the data  
(including conventions such as Y-axis through the nose), why do we  
need to change it? You mentioned that volumesegment works better with  
CTF coordinates? So, does the segmentation algorithm make assumptions  
about where brain regions are based on the axis? Also, what other  
function in fieldtrip depend on such coordinate system, and would not  
work just by having the data coordinate system match the volume's?

2) So, let's say I already have segmented MRIs. If I just import that  
(and assuming volumesegment with the assumptions above), is it  
possible to go ahead with other steps such as prepare_bem, and  
prepare_singleshell?

Thanks,

Gus

On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote:

> Hi Hanneke,
>
> Please note that the X and Y axis in the neuromag head-coordinate  
> system are swapped with respect to the CTF and 4D convention; i.e. X  
> axis through the ears, and Y-axis to the nose.
> What usually works for me is discarding the mri.transform (mri =  
> rmfield(mri, 'transform'), and call volumerealign in the interactive  
> mode. You can then specify the location of the fiducials yourself
> and the output mri of the function will contain a transformation  
> matrix according to ctf convention. This at least ensures that  
> volumesegment etc kind of work properly. Yet, it is important to  
> know that of course the gradiometer positions in the data are  
> defined in neuromag convention, so after preparing your volume  
> conduction model you probably have to swap the x and y coordinates  
> of the vol.bnd.pnt (assuming you use a singleshell as volume  
> conductor model), before proceeding to visualization (headmodelplot;  
> just to check whether the head fits in the helmet), leadfield  
> computation (only makes sense if the head fits in the helmet), and  
> sourceanalysis (idem).
>
> Yours,
>
> JM
>
>
>
>
> On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote:
>
>> 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.<read_mri.m>
>
> ----------------------------------
> 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.



More information about the fieldtrip mailing list