0001 function o = my_loadroi(fname)
0002
0003
0004
0005
0006 if isa(fname, 'maroi')
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