Buyean
The error is due to the volume structures being set up differently in spm2
and spm5.
You need to add something like this just after the VO = V; line (note: I
have not tested this).
if ~spm5
if isfield(VO,'dt')
VO.dim(4) = VO.dt(1);
VO = rmfield(VO,'dt');
end
else
if ~isfield(VO,'dt')
VO.dt = [VO.dim(4) 0];
VO.dim = VO.dim(1:3);
end
end
darren
----------
Darren Gitelman, MD
Department of Neurology
Northwestern University
voice: (312) 908-8614
fax: (312) 908-5073
page: (312) 695-1849
email: [log in to unmask]
----------
> -----Original Message-----
> From: SPM (Statistical Parametric Mapping)
> [mailto:[log in to unmask]] On Behalf Of Buyean Lee
> Sent: Wednesday, November 14, 2007 7:24 PM
> To: [log in to unmask]
> Subject: [SPM] Error message again: resize_image in SPM5
>
> Dear SPMers,
>
> Any comment for the following error message will be appreciated.
>
>
>
>
>
> I am trying to reslice the image to diplay in another program.
> The program is resize_img.m
> (http://www.sph.umich.edu/~nichols/JG5/resize_img.m
> <http://www.sph.umich.edu/%7Enichols/JG5/resize_img.m> ).
> It runs without errors in SPM2, but not in SPM5.
>
> In SPM5, the program runs well until it needs to write the image.
> Please let me know what the error following messages mean.
>
> Thank you,
>
> Buyean
>
> ??? Error using ==> @file_array/private/dim>asgn at 35 "dim"
> must be a vector of positive integers.
>
> Error in ==> @file_array/private/dim at 16
> varargout{1} = asgn(varargin{:});
>
> Error in ==> file_array.file_array at 32
> if nargin>=2, a = dim(a,varargin{2}); end;
>
> Error in ==> spm_create_vol>create_vol at 77
> dat = file_array(V.fname,dim,[dt{1} '-'
> dt{2}],0,V.pinfo(1),V.pinfo(2));
>
> Error in ==> spm_create_vol at 16
> v = create_vol(V(i));
>
> Error in ==> resize_img at 101
> VO = spm_create_vol(VO);
>
> Error in ==> spm at 756
> evalin('base',xTB(i).prog);
>
> ??? Error using ==>
> spm('TBlaunch',get(gcbo,'UserData'),get(gcbo,'Value')-1),
> set(gcbo,'Value',1) Error using ==>
> @file_array/private/dim>asgn at 35 "dim" must be a vector of
> positive integers.
>
> ??? Error while evaluating uicontrol Callback
>
>
> ________________________________
>
> Check Out the new free AIM(R) Mail
> <http://o.aolcdn.com/cdn.webmail.aol.com/mailtour/aim/en-us/in
> dex.htm> -- Unlimited storage and industry-leading spam and
> email virus protection.
>
>
|