Print

Print


It did not find the file you told it to look for. The file name is empty. 

The key is this:
Error reading header file "".
There is nothing in the quotes because the file name is emty. 

Best, 
Colin Hawco, PhD
Neuranalysis Consulting
Neuroimaging analysis and consultation
www.neuranalysis.com
[log in to unmask]




-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On Behalf Of Jennifer Panitz
Sent: July-19-16 12:35 PM
To: [log in to unmask]
Subject: [SPM] SPM error running first level analysis batch (fMRI)

Hi,

I am trying to run a first level analysis (fMRI) with Andrew Jahn's batch script (http://andysbrainblog.blogspot.ca/2014/06/running-spm-first-level-analyses-from.html), but I keep getting this error message:

Running job #1
------------------------------------------------------------------------
Running 'fMRI model specification'
Failed 'fMRI model specification'
Error using read_hdr (line 32)
Error reading header file "".
In file "[log in to unmask]" (v4967), function "read_hdr" at line 32.
In file "[log in to unmask]" (v4986), function "nifti" at line 26.
In file ".../MATLAB/spm12/spm_select.m" (v6530), function "spm_select_get_nbframes" at line 268.
In file ".../MATLAB/spm12/spm_select.m" (v6530), function "spm_select_expand" at line 254.
In file ".../MATLAB/spm12/spm_select.m" (v6530), function "spm_select" at line 130.
In file ".../MATLAB/spm12/config/spm_run_fmri_spec.m" (v6562), function "spm_run_fmri_spec" at line 125.

The following modules did not run:
Failed: fMRI model specification

Error using MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing the exact #job as displayed in this error message)


The error occurs at line 238 of the script:

spm_jobman('run', jobs)
    
    if ESTIMATE_GLM == 1
        load SPM;
        spm_spm(SPM);
    end


At line 32 in read_hdr.m it says the following:

[hdr,be] = read_hdr_raw(hname);
if isempty(hdr)
error('Error reading header file "%s".',hname); end

The files I'm trying to process are in the Nifti format (.nii). If I let the script run up to the point where the error is caused, .mat files for each run (and each participant) are created, containing the names, onsets, and durations. So that seems to be working. So far I've tried removing and re-adding paths, removing and reinstalling SPM12, and finding out what it means that hdr is empty.
However, I am a Matlab beginner and googling has been very much unsuccessful. Any input on the issue and what might be going wrong would be very much appreciated!

Best,
Jennifer Panitz