I know, I did the same for SPM99 (batching was hacking by definition in
spm99). The original batch version always showed the `thermometer'
dureing reistration, estimation, etc, and after making the design, the
graphics window always popped up.
But then I guess that noone is interested in spm99 anymore... I'm often
tempted though...
This was the code I used to batch everything in spm99. No windows
popping up, no keyboard or mouse input required.
http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind03&L=SPM&P=R236640&I=-3
Hope it is useful...
Best
Alle Meije
Robert Welsh wrote:
> Hi All,
>
> There has been recent exchanges about running spm without graphics,
> having the ability to log out of your workstation and walk away knowing
> that your batch processing is still running.
>
> Well good news, we DEFINITELY run all of spm (spm2) WITHOUT any
> graphical output on linux machines and mac os x. Been doing so for > 1
> year. It's wonderful to launch into the background, I even start matlab
> via shell scripts and have them email me when completed, so I can go and
> enjoy a drink while the computers hum away.
>
> You just need to hack (with my apologies to the coders of spm) the code
> a little, as an example: patch your spm_spm like this:
>
> % For those interested, the analysis proceeds a "block" at a time,
> % The block size conforms to maxMem that can be set as a global variable
> % MAXMEM (in bytes) [default = 2^20]
> %
> %_______________________________________________________________________
> % @(#)spm_spm.m 2.66 Andrew Holmes, Jean-Baptiste Poline, Karl Friston
> 03/03/27
> SCCSid = '2.66';
>
> % Turn off the graphical output.
>
> global UMBatch
>
> if exist('UMBatch')
> if length(UMBatch) > 0
> if UMBatch ~= 0
> UMBatch = 1;
> end
> end
> end
>
> %-Say hello
> %-----------------------------------------------------------------------
> SPMid = spm('FnBanner',mfilename,SCCSid);
> if UMBatch == 0
> Finter = spm('FigName','Stats: estimation...');
> spm('Pointer','Watch')
> end
> %-Get SPM.mat if necessary
> %-----------------------------------------------------------------------
>
>
> Then you need to patch all occurences like this:
>
> %=======================================================================
> %- E N D: Cleanup GUI
> %=======================================================================
> fprintf('%s%30s\n',sprintf('\b')*ones(1,30),'...done') %-#
> if UMBatch == 0
> spm('FigName','Stats: done',Finter); spm('Pointer','Arrow')
> end
> fprintf('%-40s: %30s\n','Completed',spm('time')) %-#
> fprintf('...use the results section for assessment\n\n') %-#
>
> You will need to also patch spm_progress and spm_fMRI_design
>
> For everyones convience, I am including our local spm_spm.m,
> spm_fMRI_design, spm_fmri_spm_ui.m, spm_progress_bar.m.
>
> Now be aware, if you don't specify all that your need for your SPM.mat
> when calling the design checks and estimation then it will attempt to
> open graphical output and result in an error. You will also get error if
> you are attempting to overwrite an existing SPM design or estimation. I
> have not disabled those features.
>
> However, if all is COMPLETE and CORRECT then you will have smooth
> sailing.
>
> To use just point to these files in your matlab path overriding the
> normal distribution and declare the following in your matlab code:
>
> global UMBatch
> UMBatch = 1;
>
> Please NOTE: USE AT YOUR OWN RISK.
>
> Robert Welsh
>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> Robert C. Welsh, PhD
> Research Investigator
> Department of Radiology
> University of Michigan
> (734) - 764 - 2412 (fax)
> [log in to unmask]
___________________________________________________________
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html
|