Hi Owen,
this might not exactly be what you want - but you can modify easily to your
needs:
in spm_fmri_ui around line 228, I do the following, which allows me instead
of selecting images to select a previous SPM.mat file from which the image
locations are copied (i=nsess means this will be done for all the sessions
in the design. If you only want to do this for one session at a time, omit
this line and change the P=temp... accordingly):
% check data are specified
%-----------------------------------------------------------------------
try
SPM.xY.P;
catch
% get filenames
%---------------------------------------------------------------
P = [];
for i = 1:nsess
str = sprintf('select scans for session %0.0f',i);
q = spm_get([1 nscan(i)],'.img',str);
%modification by Helmut Laufs to copy image filenames from previous
%SPM.mat
if findstr(q(1,:),'SPM.mat') %check whether instead of an image, an
SPM.mat file was entered
clear temp
temp=load(deblank(q(1,:)));
P=temp.SPM.xY.P; %assign from previous design
clear temp
i=nsess;
break
else
P = strvcat(P,q);
end %if findstr
%end of modification; next line was:
%P = strvcat(P,q);
end
% place in data field
%---------------------------------------------------------------
SPM.xY.P = P;
end
Hope this helps,
Helmut
----- Original Message -----
From: "Owen O'Daly" <[log in to unmask]>
Sent: Thursday, June 30, 2005 6:33 PM
Subject: filename lists and command line
> Hi
> i have a quick question about using the command line to load a large list
> of
> filenames.
>
> when i press "Keybd" the command line opens and reads
> ======================================================================
> please select image
> ======================================================================
> Current working directory: H:\MATLAB6p5\SPEED_fMRI_Analysis\NBack
> (Prepended to relative paths)
>
> Enter paths to at most 1 file:
> (Type "END" to terminate input.)
> 1 :
>
> Unsurprisingly, it refuses to allow me to add more than one name at a
> time.
> is there anyway to get it to let me paste in a list of names or to direct
> it
> to a textfile with the list?
>
> i think it should be possible but i am still pretty new to the spm
> many thanks
> Owen
>
> Andrew Holmes mentions that it can be done in
> http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind99&L=SPM&P=R106741&I=-3&X=359F012F83F7790A60&Y=spdpood%40iop.kcl.ac.uk
>>| Finally, I would love to have a button allowing to import a filenames'
>>| list from a text file... (this would be useful in the command line
>>| interface too)
>
>>Yes, a few people have asked for this. Just don't have time to do it!
>
>>As a workaround, you should be able to copy the list of filenames into the
>>Matlab command window in command-line mode, and you can get to command
>>line
>>mode from the GUI via the (now fixed) "Keybd" button.
>
>>Hope this helps,
>
>>-andrew
>
|