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 SPM struct in the workspace; '...
0022 'Please (re)run SPM results GUI''']);
0023
0024 switch lower(action)
0025 case 'init'
0026 try
0027 evalin('base', 'SPM;');
0028 evalin('base', 'VOL.M;');
0029 hReg = evalin('base', 'hReg;');
0030 RD = get(hReg,'UserData');
0031 spm_XYZreg('VReg',RD.Reg,0);
0032 mars_blob_menu;
0033 catch
0034 mars_blob_ui('reinit');
0035 end
0036 case 'reinit'
0037
0038 evalin('base','[hReg,SPM,VOL,xX,xCon,xSDM] = spm_results_ui;');
0039
0040 mars_blob_menu;
0041 case 'save_one'
0042 xSPM = evalin('base', 'SPM', ['error(' errstr ')']);
0043 xSPM.M = evalin('base', 'VOL.M', ['error(' errstr ')']);
0044
0045 pt = spm_results_ui('GetCoords');
0046 mars_blob2roi(xSPM, pt);
0047 case 'save_many'
0048 xSPM = evalin('base', 'SPM', ['error(' errstr ')']);
0049 xSPM.M = evalin('base', 'VOL.M', ['error(' errstr ')']);
0050 mars_blobs2rois(xSPM);
0051 otherwise
0052 error(['Worried by request for ' action]);
0053 end