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

Alexandre Gramfort gramfort at nmr.mgh.harvard.edu
Fri Feb 11 17:27:50 CET 2011


Hi,

the pb should be fixed now on:

https://github.com/mne-tools/mne-matlab

scott confirmed it works for his needs.

FYI the files are always closed now and reopened when necessary.

Alex

On Wed, Feb 9, 2011 at 4:33 PM, Laurence Hunt <lhunt at fmrib.ox.ac.uk> wrote:
> 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
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in error
> but does not contain patient information, please contact the sender and properly
> dispose of the e-mail.
>
>




More information about the fieldtrip mailing list