0001 function mars_blob_ui(action)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if nargin < 1
0018 action = 'init';
0019 end
0020
0021 errstr = sprintf(['''Cannot find xSPM struct in the workspace; '...
0022 'Please (re)run SPM results GUI''']);
0023
0024 switch lower(action)
0025 case 'init'
0026 try
0027 evalin('base', 'xSPM;');
0028 hReg = evalin('base', 'hReg;');
0029 spm_XYZreg('CleanReg',hReg);
0030 mars_blob_menu;
0031 catch
0032 mars_blob_ui('reinit');
0033 end
0034 case 'reinit'
0035
0036 evalin('base', '[hReg,xSPM,SPM] = spm_results_ui;');
0037
0038 mars_blob_menu;
0039 case 'save_one'
0040 xSPM = evalin('base', 'xSPM', ['error(' errstr ')']);
0041
0042 pt = spm_results_ui('GetCoords');
0043 mars_blob2roi(xSPM, pt);
0044 case 'save_many'
0045 xSPM = evalin('base', 'xSPM', ['error(' errstr ')']);
0046 mars_blobs2rois(xSPM);
0047 otherwise
0048 error(['Worried by request for ' action]);
0049 end