Home > marsbar > spm5 > 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 SPM2 / SPM5 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: mars_blob_ui.m 184 2004-01-18 11:26:08Z matthewbrett $  

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 SPM2 / SPM5 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: mars_blob_ui.m 184 2004-01-18 11:26:08Z matthewbrett $
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 % and find valid SPM results stuff
0027     evalin('base', 'xSPM;');
0028     hReg = evalin('base', 'hReg;');
0029     spm_XYZreg('CleanReg',hReg);
0030     mars_blob_menu;
0031   catch % give up and get a new one
0032     mars_blob_ui('reinit');
0033   end
0034  case 'reinit'
0035   % Display SPM results
0036   evalin('base', '[hReg,xSPM,SPM] = spm_results_ui;');
0037   % Menu
0038   mars_blob_menu;
0039  case 'save_one'
0040   xSPM = evalin('base', 'xSPM', ['error(' errstr ')']);
0041   %-Get current location
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

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