[FieldTrip] FT doesn't close .fif files

Scott Burns sburns at nmr.mgh.harvard.edu
Fri Feb 4 17:12:46 CET 2011


FieldTrip Experts -

I'm building a FieldTrip pipeline for use on M/EEG data collected on a Neuromag 306 system.  Because I'm looping over subjects (13 currently), event type (5 unique events), and number of runs (4), there's lots of preprocessing to do.  After processing a certain amount of files, MATLAB refuses to open more files. 

I ran 'lsof MATLAB | grep "/autofs/cluster/kuperberg/" (to only include the data files I'm using, not MATLAB's system files) and found that for every innermost loop, my script is opening the .fif file twice and not releasing it.  I use a custom function for ft_definetrial and in that I use ft_read_event (that operates on the .fif file). After defining trials, I use ft_preprocessing.

I would venture to guess that both ft_read_event and ft_read_data (ft_preprocessing:line 492) are either 1) not closing files they've opened (presumably through MNE functions), or 2) they're using shared code that doesn't close files.  I use MNE and haven't run into this issue before.  That being said, fclose('all') does close all these files but I think it's still worth looking into.

FWIW I'm using CentOS 5 and MATLAB R2010B (glnxa64).


Scott Burns
Kuperberg Lab
Martinos Center for Biomedical Imaging
sburns at nmr.mgh.harvard.edu

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.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110204/75dd1f56/attachment-0001.html>


More information about the fieldtrip mailing list