Print

Print


ok. i'm not sure what that means without an error message. 

In any case try the following. I understand what you have said about the paths but please try this
anyway.

start matlab
start spm5
now type 'path' in the matlab command window. look over all the paths to see if spm2 is listed as
part of any of the paths in addition to spm5.

if spm2 is in the path then that is the problem.
if not then where is resize_img.m in your matlab path? are there any spm functions in the same
directory as resize_img.m?

darren

==============Original message text===============
On Thu, 15 Nov 2007 5:11:23 pm CST [log in to unmask] wrote:


 Hi,

Our computer guy tested your code and said that resize_img doen't allow your code to work.

Thank you, 

Buyean


 


 

-----Original Message-----
From: d gitelman <[log in to unmask]>
To: [log in to unmask]; [log in to unmask]
Cc: [log in to unmask]
Sent: Thu, 15 Nov 2007 4:55 am
Subject: RE: [SPM] Error message again: resize_image in SPM5










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.
> 
> 





 


________________________________________________________________________
Check Out the new free AIM(R) Mail -- Unlimited storage and industry-leading spam and email virus
protection.
===========End of original message text===========



--------------------------------
Darren R. Gitelman, M.D.
Department of Neurology
710 N. Lake Shore Dr. #1122
Chicago, IL 60611
Voice: (312) 908-8614
Fax:   (312) 908-5073
--------------------------------