[FieldTrip] Fwd: FT doesn't close .fif files

Laurence Hunt lhunt at fmrib.ox.ac.uk
Wed Feb 9 22:33:13 CET 2011


Thanks Alex - I guess it might also be useful to add to the mne code instead, as long as it doesn't cause any problems elsewhere for other users...? Thinking about it, I reckon it would work if you used the same solution you suggested previously on your website, but just added

data.pos = ftell(data.fid); %before running fclose in fiff_setup_read_raw

and

fseek(raw.fid,raw.pos); %after re-opening the file in fiff_read_raw_segment

(...followed by an fclose of raw.fid at the end of fiff_read_raw_segment, of course).

If you did this, it would save us making any changes in fieldtrip at all :)

Laurence

===========================================
Laurence Hunt, DPhil Student
 Centre for Functional MRI of the Brain (FMRIB), 
University of Oxford
lhunt at fmrib.ox.ac.uk
Phone: (+44)1865-(2)22738
===========================================

On 9 Feb 2011, at 21:17, Alexandre Gramfort wrote:

> again if something needs to be changed in the mne matlab code
> I'd be happy to help.
> 
> Alex
> 
> On Wed, Feb 9, 2011 at 4:12 PM, Laurence Hunt <lhunt at fmrib.ox.ac.uk> wrote:
>> I think it should be possible to do it this way - when I tested it, it seemed to work OK.
>> 
>> On 9 Feb 2011, at 20:48, Vladimir Litvak wrote:
>> 
>>> If, however, it is sufficient to store in the header a
>>> single number which can then be used to find the data onset and from
>>> there to find where to start reading (so perhaps not an fid but just
>>> the data offset in bytes to do fseek), that'd be a perfectly good
>>> solution and fast as well. But I don't know enough about  fif format
>>> to say if it's possible.
>> 
>> ===========================================
>> Laurence Hunt, DPhil Student
>>  Centre for Functional MRI of the Brain (FMRIB),
>> University of Oxford
>> lhunt at fmrib.ox.ac.uk
>> Phone: (+44)1865-(2)22738
>> ===========================================
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 





More information about the fieldtrip mailing list