help > RE: Recurring error when Importing ROI data
Apr 19, 2014  05:04 AM | Alfonso Nieto-Castanon - Boston University
RE: Recurring error when Importing ROI data
Hi Harriet,

This seems to be an SPM-specific issue, there seem to be a few threads about this issue in the SPM list (search 'fclose invalid file identifier') but no apparent fix as far as I can tell. Is your data stored locally on your machine? (my guess would be that this could be some issue with remote storage so perhaps if you run your analyses locally it would improve?). Just as a quick 'hack', I would suggest to go ahead and edit the file 'read_hdr_raw.m' (stored in the spm/@nifti/private/ folder), and change line 86 (which reads 'fclose(fp);') to:

try, fclose(fp); end

This would not fix the actual 'cause' of the problem, but it may allow you to run the analyses without so much trouble. In any way, let me know if you are able to gather more information.

Best
Alfonso

Originally posted by Harriet Johnston:
I'm getting an error in the Importing ROI data setup step. "Error using close ...Invalid file identifier" - I include the full text below...
I've simplified and standardized my file structure as well as limited the ROIs I'm including - but getting the same error -
right now I've just been reinitiating the setup which takes me a little further each time - but then I have to do this repeatedly until it is finished this step. 
Has anyone encountered and solved this problem - or any suggestions.
Thx


Error using fclose
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in read_hdr_raw (line 86)
fclose(fp);
Error in read_hdr (line 33)
[hdr,be] = read_hdr_raw(hname);
Error in nifti (line 27)
vol = read_hdr(fname);
Error in spm_vol_nifti (line 16)
N = nifti(fname);
Error in spm_vol>subfunc (line 124)
V = spm_vol_nifti(p,n);
Error in spm_vol>subfunc1 (line 77)
v = subfunc(P(i,:));
Error in spm_vol>subfunc2 (line 69)
V = subfunc1(P);
Error in spm_vol (line 54)
V = subfunc2(P);
Error in rex (line 146)
params.VF=spm_vol(temp);
Error in conn_rex (line 8)
[varargout{1:nargout}]=rex(varargin{:});
Error in conn_process (line 499)
[data{nroi1},namesroi{nroi},params]=conn_rex(Vsourcethis,Vmask{nroi},'summary_measure','mean','conjunction_mask',mask,'level',level,'scaling',scalinglevel,'select_clusters
Error in conn_process (line 11)
case 'setup', disp(['CONN: RUNNING SETUP STEP']); conn_process([0:5]);
Error in conn (line 1217)
conn_process('setup');
Error in conn_menumanager (line 117)
feval(MM.MENU{n0}.callback{n1}{1},MM.MENU{n0}.callback{n1}{2:end});
Error while evaluating figure WindowButtonUpFcn

Threaded View

TitleAuthorDate
Harriet Johnston Apr 16, 2014
RE: Recurring error when Importing ROI data
Alfonso Nieto-Castanon Apr 19, 2014
Alfonso Nieto-Castanon Apr 21, 2014
Harriet Johnston Apr 22, 2014