Home > marsbar > @maroi > c_o_m.m

c_o_m

PURPOSE ^

c_o_m method - calculates unweighted centre of mass

SYNOPSIS ^

function pt = c_o_m(o, sp, pt_type)

DESCRIPTION ^

 c_o_m method - calculates unweighted centre of mass

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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);

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