matrixdata method - gets matrix from ROI object $Id$
0001 function dat = matrixdata(o, dat) 0002 % matrixdata method - gets matrix from ROI object 0003 % 0004 % $Id$ 0005 0006 % a warning here about empty matrices 0007 if nargin > 1 % call to set matrix data 0008 % change to maroi_matrix type before setting data 0009 o = maroi_matrix(o); 0010 0011 % apply implied thresholding 0012 tmp = find(isnan(dat) | abs(dat) < roithresh(o)); 0013 if binarize(o), dat(:) = 1; end 0014 dat(tmp) = 0; 0015 0016 o.dat = dat; 0017 dat = o; 0018 0019 else 0020 dat = o.dat; 0021 end