Home > marsbar > @maroi > private > my_loadroi.m

my_loadroi

PURPOSE ^

my_loadroi function - loads ROI from file, sets source field

SYNOPSIS ^

function o = my_loadroi(fname)

DESCRIPTION ^

 my_loadroi function - loads ROI from file, sets source field

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function o = my_loadroi(fname)
0002 % my_loadroi function - loads ROI from file, sets source field
0003 %
0004 % $Id$
0005 
0006 if isa(fname, 'maroi')  % already loaded
0007   o = fname;
0008   return
0009 end
0010 
0011 o = [];
0012 if iscell(fname), fname = char(fname); end
0013 if size(fname, 1) > 1, error('Can only load one ROI at a time'); end
0014 if isempty(fname), warning('Empty filename'), return, end
0015 fname = deblank(fname);
0016 F = load(fname);
0017 if isfield(F, 'roi') & isa(F.roi, 'maroi')
0018   o = F.roi;
0019   o = source(o, fname);
0020 else
0021   warning(['Loading file ' fname ' did not return an ROI'])'
0022 end

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