Hi Owen,
Correction: add a comma (after the '1') in the following line so you can
select just one image.
q = spm_get([1, nscan(i)],'.img',str);
Another useful way to deal with many subjects and the 2nd level is to either
put them all into one big fixed analysis first, so all the con images are in
one folder. Also, if you really want, you can try to have 10 contrasts per
session so you can then easily filter those conimages which end on the same
digit (i.e. for every session you select, e.g. con_*2.img). Put this of
course, has to be considered beforehand. Also, if your sessions are in
separate directories, using the filter option of the spm_get dialogue should
help, assumed your contrasts match across subjects (which they should)...
Sorry for the tiny bug posted before,
Helmut
----- Original Message -----
From: "Owen O'Daly" <[log in to unmask]>
To: "Helmut Laufs" <[log in to unmask]>
Sent: Friday, July 01, 2005 11:24 AM
Subject: Re: filename lists and command line
> Hi Helmut
> thanks for that
> i am just starting the 2nd level and have 22 subjects scanned twice on 4
> tasks
> my problem is that after the first level analysis, for some tasks, i have
> lots of con images (>50) and so to have to select them individually to
> create that first 2nd level design matrix will take forever.
> that said, once it is created your amendment to spm_fmri_ui will really
> help. unless i have missed something, i am still pretty new to this stuff
> :-)
> thanks
> O
> ----- Original Message -----
> From: "Helmut Laufs" <[log in to unmask]>
> To: "Owen O'Daly" <[log in to unmask]>
> Cc: "SPM (Statistical Parametric Mapping)" <[log in to unmask]>
> Sent: Friday, July 01, 2005 8:38 AM
> Subject: Re: filename lists and command line
>
>
>> 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
>>>
>
>
|