0001 function o = maroi_box(params)
0002
0003
0004
0005
0006
0007
0008
0009
0010 myclass = 'maroi_box';
0011 defstruct = struct('centre', [0 0 0], 'widths', [0 0 0]);
0012
0013 if nargin < 1
0014 params = [];
0015 end
0016 if isa(params, myclass)
0017 o = params;
0018 return
0019 end
0020
0021
0022 pparams = mars_struct('ffillmerge', defstruct, params);
0023
0024
0025 [uo, pparams] = maroi_shape(pparams);
0026
0027
0028 [pparams, others] = mars_struct('split', pparams, defstruct);
0029
0030
0031 if size(pparams.centre, 2) == 1
0032 pparams.centre = pparams.centre';
0033 end
0034 if size(pparams.widths, 2) == 1
0035 pparams.widths = pparams.widths';
0036 end
0037 if size(pparams.widths, 2) == 1
0038 pparams.widths = ones(1,3) * pparams.widths;
0039 end
0040
0041 o = class(pparams, myclass, uo);
0042 return