


maroi_sphere - class constructor
FORMAT [o, others] = maroi_sphere(params)
Inputs [defaults]
params - a structure containing any fields for a maroi parent and
.centre - a 1x3 coordinate in mm
.radius - a 1x1 radius in mm
$Id$


0001 function [o, others] = maroi_sphere(params) 0002 % maroi_sphere - class constructor 0003 % FORMAT [o, others] = maroi_sphere(params) 0004 % Inputs [defaults] 0005 % params - a structure containing any fields for a maroi parent and 0006 % .centre - a 1x3 coordinate in mm 0007 % .radius - a 1x1 radius in mm 0008 % 0009 % 0010 % $Id$ 0011 0012 myclass = 'maroi_sphere'; 0013 defstruct = struct('centre', [0 0 0],'radius', 0); 0014 0015 if nargin < 1 0016 params = []; 0017 end 0018 if isa(params, myclass) 0019 o = params; 0020 return 0021 end 0022 0023 % fill with defaults 0024 pparams = mars_struct('ffillmerge', defstruct, params); 0025 0026 % umbrella object, parse out fields for (this object and children) 0027 [uo, pparams] = maroi_shape(pparams); 0028 0029 % reparse parameters into those for this object, children 0030 [pparams, others] = mars_struct('split', pparams, defstruct); 0031 0032 % check resulting input 0033 if size(pparams.centre, 2) == 1 0034 pparams.centre = pparams.centre'; 0035 end 0036 % enforce radius as double for vox->mm conversions 0037 pparams.radius = double(pparams.radius) 0038 0039 o = class(pparams, myclass, uo); 0040 return