0001 function vb_act_area_viewer(brain_file, varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 e = vb_define_extension;
0023 Nargs = nargin-1;
0024 if Nargs >= 1
0025 for k=1:Nargs
0026 input = varargin{k};
0027 if strfind(input, e.AREA_EXTENSION)
0028 area_file = input;
0029 elseif strfind(input, e.FMRI_EXTENSION)
0030 act_file = input;
0031 elseif isempty(input)
0032 else
0033 error('Unknown input. Please check function usage');
0034 end
0035 end
0036 end
0037
0038 if ~exist('brain_file', 'var')
0039 brain_file = '';
0040 end
0041 if ~exist('act_file', 'var')
0042 act_file = '';
0043 end
0044 if ~exist('area_file', 'var')
0045 area_file = '';
0046 end
0047
0048
0049
0050
0051 brain_exist = exist(brain_file, 'file');
0052 act_exist = exist(act_file, 'file');
0053 area_exist = exist(area_file, 'file');
0054
0055 if brain_exist && act_exist && area_exist
0056
0057 job_view_cortex_init(brain_file, '--area', area_file, '--act', act_file);
0058 elseif brain_exist && ~act_exist && ~area_exist
0059
0060 job_view_cortex_init(brain_file);
0061 elseif brain_exist && area_exist && ~act_exist
0062
0063 job_view_cortex_init(brain_file, '--area', area_file);
0064 elseif brain_exist && act_exist && ~area_exist
0065
0066 job_view_cortex_init(brain_file, '--act', act_file);
0067 else
0068 job_view_cortex_init;
0069 end