0001 function [head_parm] = pa_head_get_parm(fig)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0017 error('invalid figure handle is specified.');
0018 end
0019
0020
0021
0022
0023
0024 data = guidata(fig);
0025 H = data.H;
0026
0027 head_parm = struct;
0028
0029
0030 if get(H.model_1shell_radiobutton, 'Value')
0031 head_parm.Nsurf = 1;
0032 head_parm.Nvertex = str2num(get(H.vertices_1shell_edit, 'String'));
0033 elseif get(H.model_3shell_radiobutton, 'Value')
0034 head_parm.Nsurf = 3;
0035 head_parm.Nvertex = str2num(get(H.vertices_3shell_edit, 'String'));
0036 end
0037
0038
0039 head_parm.vstep = str2num(get(H.voxel_size_edit, 'String'));
0040
0041
0042 head_parm.analyze_file = get(H.analyze_file_edit, 'String');
0043
0044
0045
0046
0047 if get(H.csf_source_popup, 'Value') == 1
0048
0049 head_parm.gray_file = get(H.gray_file_edit, 'String');
0050 head_parm.brain_file = get(H.brain_file_edit, 'String');
0051 head_parm.Radius_csf = eval(get(H.gray_morphology_edit, 'String'));
0052 fs_file = get(H.fs_csf_file_edit, 'String');
0053 if ~isempty(fs_file)
0054 head_parm.freesurf_file = fs_file;
0055 head_parm.Radius_fs = eval(get(H.fs_morphology_edit, 'String'));
0056 end
0057 elseif get(H.csf_source_popup, 'Value') == 2
0058
0059 head_parm.Radius = eval(get(H.curry_morphology_edit, 'String'));
0060 head_parm.curry_file = get(H.curry_file_edit, 'String');
0061 else
0062 error('CSF source is invalid.');
0063 end
0064
0065
0066
0067
0068
0069 if get(H.skull_source_popup, 'Value') == 1
0070
0071 head_parm.Radius_scalp = str2num(get(H.scalp_thickness_edit, 'String'));
0072 elseif get(H.skull_source_popup, 'Value') == 2
0073
0074 head_parm.fs_skull_file = get(H.fs_skull_file_edit, 'String');
0075 else
0076 error('Skull source is invalid.');
0077 end
0078
0079
0080 head_parm.Radius_skull = str2num(get(H.min_skull_thickness_edit, 'String'));
0081
0082
0083
0084
0085 if get(H.scalp_source_popup, 'Value') == 1
0086
0087 head_parm.fs_scalp_file = get(H.fs_scalp_file_edit, 'String');
0088 elseif get(H.scalp_source_popup, 'Value') == 2
0089
0090 head_parm.face_file = get(H.face_file_edit, 'String');
0091 else
0092 error('Scalp source is invalid.');
0093 end
0094
0095
0096
0097 head_base = get(H.head_file_edit, 'String');
0098 head_parm.head_file = head_base;
0099
0100
0101 head_parm.comment = get(H.comment_edit, 'String');