Dear Tom, John et al,
> I'm guessing that this is from the glitch in write_hdr_raw.m, which we had to
> work around because of some MATLAB behaviour that appeared to be a bit
> unpredictable. Guillaume found and fixed the problem for Updates_1111 (and
> I managed to temporarily break a version of SPM by trying to fix it). Can
> anyone spot the bug in the first version (below)?
Everything can (I hope) be explained rationally when you are aware of
this feature of fopen:
> FILENAME can be a MATLABPATH relative partial pathname. If the file
> is not found in the current working directory, FOPEN searches for it
> on the MATLAB search path.
Thus, if your Matlab path contains path to a previous analysis, some
header files of identical filenames were not being created (such as
RPV.hdr). This should now be fixed in SPM5 with Updates 1111 by using
full path when writing headers.
Also, Tom, to resolve some of your anxiety:
1) At the model estimation stage, files are only written (or at least
SPM believes so) and not read so it makes sense not to see any error
message.
2) 'dbstop if error' might not be enough sometimes and you might need to
resort to 'dbstop if caught error' as jobs are run in a try/catch.
And the bottom line is: Update!
I hope this helps,
Guillaume.
> On Friday 15 February 2008 09:41, Thomas Nichols wrote:
>> John & Unal,
>>
>> Just for the record, I get this error too
>> Error running job:
>> Error using ==> @nifti/private/read_hdr
>> Error reading header file "RPV.hdr"
>> with a 1st level fMRI job. I've ruled out file permissions problems, and
>> what's really strange is that (1) the job seems to complete normally with
>> no errors otherwise, and (2) when I repeat the run with 'debug error' on,
>> the error isn't caught.
>>
>> However, I get this with a fairly elderly version of SPM5, highest version
>> id 570, dating from 2006-07-05 (that's my favorite SPM5 vintage, I must
>> say, before all the changes last summer :) which could be the source of the
>> problem.
>>
>> -Tom
>>
>>
>> On Wed, Jan 16, 2008 at 1:16 PM, John Ashburner <[log in to unmask]>
>>
>> wrote:
>>> I could only replicate this problem by removing write-permission from the
>>> file. If this is not the cause, then it could be useful to know which
>>> release of SPM5 you are using, which MATLAB version and what sort of
>>> computer
>>> you are running it on.
>>> Best regards,
>>> -John
>>>
>>>> I am running a routine that uses spm function spm_read_vols and on one
>>> data
>>>
>>>> folder (namely, E04), it runs fine, but on another (namely E06) I get
>>> the
>>>
>>>> following error message. Both folders contain similarly processed data
>>>> (that is, realigned and resliced nifti volume files).
>>>>
>>>> --------Error message: -----
>>>> Found 104 ruvol*.* images in the folder ...\NiftiFiles\func-MoCoed\E06
>>>>
>>>> ??? Error using ==> @nifti\private\read_hdr
>>>> Error reading header file "ruvol_001.nii"
>>>>
>>>> Error in ==> nifti.nifti at 27
>>>> vol = read_hdr(fname);
>>>>
>>>> Error in ==> spm_vol_nifti at 16
>>>> N = nifti(fname);
>>>>
>>>> Error in ==> spm_vol>subfunc at 121
>>>> if isempty(n), V = spm_vol_nifti(p);
>>>>
>>>> Error in ==> spm_vol>subfunc1 at 83
>>>> v = subfunc(P(i,:));
>>>>
>>>> Error in ==> spm_vol>subfunc2 at 71
>>>> V = subfunc1(P);
>>>>
>>>> Error in ==> spm_vol at 57
>>>> V = subfunc2(P);
>>>>
>>>> Error in ==> US_BOLD_Nifti at 91
>>>> [CubeRaw_unrotated,XYZ]=spm_read_vols(spm_vol(ruvol_files));
>>>> ----error message end ----
>>>>
>>>> Seems like the function read_hdr has some problem with the volume's
>>>> header, but I don't see a reason why.
>>>> I am just puzzled, I would appreciate any help. I am also attaching
>>>> ruvol_001.nii.
>>>> Thanks,
>
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|