c_o_m method - calculates unweighted centre of mass $Id$
0001 function pt = c_o_m(o, sp, pt_type) 0002 % c_o_m method - calculates unweighted centre of mass 0003 % 0004 % $Id$ 0005 0006 if nargin < 2 0007 sp = native_space(o); 0008 end 0009 if nargin < 3 0010 pt_type = 'real'; 0011 end 0012 coords = voxpts(o, sp); 0013 switch pt_type 0014 case {'real','mm'} 0015 coords = realpts(o, sp); 0016 case 'vox' 0017 coords = voxpts(o, sp); 0018 otherwise 0019 error(['Do not recognize point type' pt_type]); 0020 end 0021 pt = mean(coords, 2);