0001 function basis_parm = vb_util_check_head_shell_info(proj_root, basis_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 if ~exist('proj_root', 'var'), proj_root = []; end
0026 if ~exist('basis_parm', 'var'), basis_parm = []; end
0027 [proj_root, basis_parm] = inner_check_arguments(proj_root, basis_parm);
0028
0029
0030
0031 func_ = 'vb_util_check_head_shell_info';
0032
0033 if ~isfield(basis_parm, 'sigma')
0034
0035 basis_parm.sigma = [ 0.62 0.03 0.62 ];
0036 end
0037
0038 if ~isfield(basis_parm, 'radius')
0039
0040 basis_parm.radius = [ 0.87 0.92 1.0 ];
0041 end
0042
0043 if ~isfield(basis_parm, 'radius_method')
0044
0045 basis_parm.radius_method = 'MEAN';
0046 else
0047 if ~strcmp(basis_parm.radius_method, 'USER') ...
0048 && ~strcmp(basis_parm.radius_method, 'MEAN') ...
0049 && ~strcmp(basis_parm.radius_method, 'MAX') ...
0050 && ~strcmp(basis_parm.radius_method, 'MIN')
0051 warning('(%s)undefined basis_parm.radius_method : %s', ...
0052 func_, basis_parm.radius_method);
0053 end
0054 end
0055
0056 if strcmp(basis_parm.radius_method, 'USER')
0057
0058
0059 if ~isfield(basis_parm, 'radius'),
0060
0061 if isfield(basis_parm, 'head_file')
0062 calc_mode = 1;
0063 rr = vb_util_calc_head_radius(proj_root, basis_parm.head_file, calc_mode);
0064 basis_parm.radius = rr;
0065 else
0066 warning('basis_parm does not have head_file.');
0067 end
0068 else
0069
0070 end
0071
0072 elseif strcmp(basis_parm.radius_method, 'MEAN')
0073 rr = vb_util_calc_head_radius(proj_root, basis_parm.head_file,1);
0074 basis_parm.radius = rr;
0075
0076 elseif strcmp(basis_parm.radius_method, 'MIN')
0077 rr = vb_util_calc_head_radius(proj_root, basis_parm.head_file,2);
0078 basis_parm.radius = rr;
0079
0080 elseif strcmp(basis_parm.radius_method, 'MAX')
0081 rr = vb_util_calc_head_radius(proj_root, basis_parm.head_file,3);
0082 basis_parm.radius = rr;
0083 else
0084 error('invalid basis_parm.radius_method : %s', basis_parm.radius_method);
0085 end
0086
0087
0088
0089
0090 if ~isfield(basis_parm, 'Recalc') || isempty(basis_parm.Recalc)
0091
0092 basis_parm.Recalc = false;
0093 end
0094
0095
0096
0097
0098
0099
0100 function [proj_root, basis_parm] = inner_check_arguments(proj_root, basis_parm)
0101 if isempty(basis_parm), error('basis_parm is a required parameter'); end
0102
0103
0104
0105