Home > functions > gui > preAnalysis > head > head_spm_curry > pa_head_get_parm.m

pa_head_get_parm

PURPOSE ^

This function gets parameters from head GUI.

SYNOPSIS ^

function [head_parm] = pa_head_get_parm(fig)

DESCRIPTION ^

 This function gets parameters from head GUI.
 [USAGE]
   [head_parm] = pa_head_get_parm(<fig>);
 [IN]
    fig : figure handle of head gui.
 [OUT]
    head_parm : head_parm for vb_job_head_3shell()

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [head_parm] = pa_head_get_parm(fig)
0002 % This function gets parameters from head GUI.
0003 % [USAGE]
0004 %   [head_parm] = pa_head_get_parm(<fig>);
0005 % [IN]
0006 %    fig : figure handle of head gui.
0007 % [OUT]
0008 %    head_parm : head_parm for vb_job_head_3shell()
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 %
0014 % --- Previous check
0015 %
0016 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0017     error('invalid figure handle is specified.');
0018 end
0019 
0020 %
0021 % --- Main Procedure
0022 %
0023 % load data(@see pa_head_create)
0024 data = guidata(fig);
0025 H = data.H; % component handles
0026 
0027 head_parm = struct;
0028 
0029 % head_parm.Nsurf
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 % Voxel size
0039 head_parm.vstep = str2num(get(H.voxel_size_edit, 'String'));
0040 
0041 % Analyze file
0042 head_parm.analyze_file = get(H.analyze_file_edit, 'String');
0043 
0044 %
0045 % --- CSF source
0046 %
0047 if get(H.csf_source_popup, 'Value') == 1
0048     % SPM segmentation file + Cortical model file
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     % Curry v4.5 surface file
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 %if head_parm.Nsurf > 1
0066     %
0067     % --- Skull source
0068     %
0069     if get(H.skull_source_popup, 'Value') == 1
0070         % use Scalp thickness
0071         head_parm.Radius_scalp = str2num(get(H.scalp_thickness_edit, 'String'));
0072     elseif get(H.skull_source_popup, 'Value') == 2
0073         % FreeSurfer surface file(outer skull)
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     % Minimum skull thickness
0080     head_parm.Radius_skull = str2num(get(H.min_skull_thickness_edit, 'String'));
0081     
0082     %
0083     % --- Scalp source
0084     %
0085     if get(H.scalp_source_popup, 'Value') == 1
0086         % FreeSurfer surface file(outer skin)
0087         head_parm.fs_scalp_file = get(H.fs_scalp_file_edit, 'String');
0088     elseif get(H.scalp_source_popup, 'Value') == 2
0089         % Face file(made by positioning program)
0090         head_parm.face_file = get(H.face_file_edit, 'String');
0091     else
0092         error('Scalp source is invalid.');
0093     end
0094 %end
0095 
0096 % Output filename
0097 head_base = get(H.head_file_edit, 'String');
0098 head_parm.head_file = head_base;
0099 
0100 % Comment
0101 head_parm.comment = get(H.comment_edit, 'String');

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005