IOt sounds like you may not have installed SPM correctly. You should
have a directory somewhere called @nifti , which contains a file
called nifti.m . If this isn't the case, then it would appear that
there was an installation problem.
Best regards,
-John
On 5 May 2011 21:49, Jadzia Jagiellowicz <[log in to unmask]> wrote:
> Hello All,
>
> I'm getting an error
> " Undefined command/function 'nifti'.
> 16 N = nifti(fname);"
>
> every time I try to run command on a series of epi scans.
>
> I've spent about 14 hours trying to figure this out by searching the web,
> and can't quite understand the problem.
> I think it is something to do with setting a path, or the directory the
> files are in, but am not sure what.
> The scans are in ANALYZE format and I'm using SPM5.
> Do my scans need to be in "nifti" format before I can realign and estimate
> them? I had done the realignment previouisly with ANALYZE files and it
> worked.
>
>
> I've ran the Matlab debugger on the error and get the following response:
> Can anyone help me interpret what to do next and what is causing the error?
>
> V = spm_vol_nifti(fname,n)
>
> % Get header information for a NIFTI-1 image.
>
> % FORMAT V = spm_vol_nifti(P)
>
> % P - filename.
>
> % n - volume id (a 1x2 array, e.g. [3,1])
>
> % V - a structure containing the image volume information.
>
> %____________________________________________________________________________
>
> % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
>
> % John Ashburner
>
> % $Id: spm_vol_nifti.m 112 2005-05-04 18:20:52Z john $
>
> if
>
> nargin<2, n = [1 1]; end;
>
> if
>
> ischar(n), n = str2num(n); end;
>
> N = nifti(fname);
>
> n = [n 1 1];
>
> n = n(1:2);
>
> dm = [N.dat.dim 1 1 1 1];
>
> if
>
> any(n>dm(4:5)), V = []; return; end;
>
> dt = struct(N.dat);
>
> dt = double([dt.dtype dt.be]);
>
> if
>
> isfield(N.extras,'mat') && size(N.extras.mat,3)>=n(1) &&
> sum(sum(N.extras.mat(:,:,n(1))))~=0,
>
> mat = N.extras.mat(:,:,n(1));
>
> else
>
> mat = N.mat;
>
> end
>
> ;
>
> off = (n(1)-1+dm(4)*(n(2)-1))*ceil(spm_type(dt(1),
>
> 'bits')*dm(1)*dm(2)/8)*dm(3) + N.dat.offset;
>
> V = struct(
>
> 'fname', N.dat.fname,...
>
> 'dim', dm(1:3),...
>
> 'dt', dt,...
>
> 'pinfo', [N.dat.scl_slope N.dat.scl_inter off]',...
>
> 'mat', mat,...
>
> 'n', n,...
>
> 'descrip', N.descrip,...
> 'private',N);
>
> Thanks in advance,
> Jadzia
> --
> Jadzia Jagiellowicz
> Doctoral Candidate
> Psychology Department B-207
> Stony Brook University,
> Stony Brook, NY 11794-2500 USA
> http://www.psychology.stonybrook.edu/aronlab-/
>
> "The brave shall inherit the earth."
>
|