Print

Print


There was a script posted to the list awhile back that allows you to 
move analysis directories after everything has been specified and 
estimated. I'm not sure if that helps your case, but it might, so here 
it is:

function [SPM] = spm_remap_scans (SPM,new_path)
% Update path to images - you'll need to do this if you
% copy your original analysis to a different position in your filesystem
% FORMAT [SPM] = spm_remap_scans (SPM,new_path)
%
% SPM       SPM data structure
% new_path 

SPM.xY.P = '';
v=length(SPM.xY.VY);
for i=1:v,
    str=SPM.xY.VY(i).fname;
    separators=find(str=='/');
    last_set=max(separators);
    file_name=str(last_set+1:end);
    new_name=[new_path,file_name];
    SPM.xY.VY(i).fname=new_name;
    SPM.xY.VY(i).private.dat.fname = new_name;
    SPM.xY.P(i,:) = new_name;
end


Wood, Tobias wrote:
> Hi Yihui,
> If you open the original batch file in SPM, and bring up the choose file dialogue for the files you need to change the directory of, to the left of the 'Done' button there should be an 'Ed' button. Press this, and you will get a simple text editor window with all the current files. Here, it should be very easy to Cut/Copy/Paste as required to change the directories.
> Hope that helps,
> Toby
> ________________________________________
> From: SPM (Statistical Parametric Mapping) [[log in to unmask]] On Behalf Of SUBSCRIBE SPM Yihui [[log in to unmask]]
> Sent: 03 August 2011 14:41
> To: [log in to unmask]
> Subject: Re: [SPM] a quick way to change the directory in batch?
>
> Dear Andreas,
>
> Thank you for the prompt response.
> I tried what your suggested. However, the new batch file can not be read by spm anymore. The error massage showed "a href=matlab: opentoline[cfg_util, 648, 0,">cfg util at 648" in a pop-out window and "Load failed: 'D:\NeuroSpin\number_syntax\fmri\sub03_ma110333\1stlevel\no_mor\1stlevel_2.mat" in matlab. Anyone has any idea about what it is wrong?
>
> Yihui
>
>