Home > marsbar > spm99 > mars_blob_ui.m

mars_blob_ui

PURPOSE ^

Displays SPM results, and ROI menu in SPM input window

SYNOPSIS ^

function mars_blob_ui(action)

DESCRIPTION ^

 Displays SPM results, and ROI menu in SPM input window
 FORMAT mars_blob_ui(action)
 
 This is the SPM99 version

 action     - action string; can be
                'init'      - initialise results interface
                'save_one'  - UI to save current cluster
                'save_many' - UI to save all clusters

 This routine does SPM version specific stuff, the main
 work is in mars_blob2roi.m and mars_blobs2rois.m

 $Id$  

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mars_blob_ui(action)
0002 % Displays SPM results, and ROI menu in SPM input window
0003 % FORMAT mars_blob_ui(action)
0004 %
0005 % This is the SPM99 version
0006 %
0007 % action     - action string; can be
0008 %                'init'      - initialise results interface
0009 %                'save_one'  - UI to save current cluster
0010 %                'save_many' - UI to save all clusters
0011 %
0012 % This routine does SPM version specific stuff, the main
0013 % work is in mars_blob2roi.m and mars_blobs2rois.m
0014 %
0015 % $Id$
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 % and find valid SPM results stuff
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 % no good, need a new one
0034     mars_blob_ui('reinit');
0035   end
0036  case 'reinit'
0037   % Display SPM results
0038   evalin('base','[hReg,SPM,VOL,xX,xCon,xSDM] = spm_results_ui;');
0039   % and menu
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   %-Get current location
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

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019