Home > phiwave > @slover > private > pr_get_spm_results.m

pr_get_spm_results

PURPOSE ^

fetches SPM results, returns as point list

SYNOPSIS ^

function [XYZ, Z, M] = pr_get_spm_results;

DESCRIPTION ^

 fetches SPM results, returns as point list
 FORMAT [XYZ, Z, M] = pr_get_spm_results;
 
 Outputs
 XYZ    - XYZ point list in voxels (empty if not found)
 Z      - values at points in XYZ
 M      - 4x4 voxel -> world transformation matrix 
 
 $Id: pr_get_spm_results.m,v 1.2 2005/05/06 22:57:40 matthewbrett Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [XYZ, Z, M] = pr_get_spm_results;
0002 % fetches SPM results, returns as point list
0003 % FORMAT [XYZ, Z, M] = pr_get_spm_results;
0004 %
0005 % Outputs
0006 % XYZ    - XYZ point list in voxels (empty if not found)
0007 % Z      - values at points in XYZ
0008 % M      - 4x4 voxel -> world transformation matrix
0009 %
0010 % $Id: pr_get_spm_results.m,v 1.2 2005/05/06 22:57:40 matthewbrett Exp $
0011   
0012 errstr = '''Cannot find SPM results in workspace''';
0013 [XYZ Z M] = deal([]);
0014 
0015 V = spm('ver');
0016 switch V(4:end)
0017  case '99'
0018   have_res = evalin('base', 'exist(''SPM'', ''var'')');
0019   if ~have_res, return, end
0020   SPM = evalin('base', 'SPM', ['error(' errstr ')']);
0021   XYZ = SPM.XYZ;
0022   Z   = SPM.Z;
0023   M   = evalin('base', 'VOL.M', ['error(' errstr ')']);
0024  case '2'
0025   have_res = evalin('base', 'exist(''xSPM'', ''var'')');
0026   if ~have_res, return, end
0027   xSPM = evalin('base', 'xSPM', ['error(' errstr ')']);
0028   XYZ = xSPM.XYZ;
0029   Z   = xSPM.Z;
0030   M   = xSPM.M;
0031  otherwise
0032   error(['Strange SPM version ' V]);
0033 end

Generated on Wed 06-Jul-2005 18:07:21 by m2html © 2003