%-----------------------------------------------------------------------
% Job configuration created by cfg_util (rev $Rev: 4899 $)
%-----------------------------------------------------------------------
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.type = 'cfg_entry';
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.name = 'String';
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.tag = 'instr';
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.strtype = 's';
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.extras = [];
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.num = [0 Inf];
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.check = [];
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.help = {'Enter a string.'};
matlabbatch{1}.menu_cfg{1}.menu_entry{1}.conf_entry.def = [];
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.type = 'cfg_entry';
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.name = 'Evaluated Input';
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.tag = 'ineval';
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.strtype = 'e';
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.extras = [];
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.num = [];
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.check = [];
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.help = {'Enter an evaluated input.'};
matlabbatch{2}.menu_cfg{1}.menu_entry{1}.conf_entry.def = [];
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'NIfTI Images';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'innifti';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'image';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.num = [0 Inf];
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'Select NIfTI Images'};
matlabbatch{3}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'MATLAB .mat Files';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'inmat';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'mat';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.num = [0 Inf];
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'Select MATLAB .mat files.'};
matlabbatch{4}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'Any Files';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'inany';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'any';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.num = [0 Inf];
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'Select any kind of files.'};
matlabbatch{5}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'Directory';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'indir';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'dir';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.num = [1 Inf];
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'Directory'};
matlabbatch{6}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.type = 'cfg_repeat';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.name = 'Job Inputs';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.tag = 'inputs';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).sname = 'Entry: String (cfg_entry)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).src_exbranch = substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1).sname = 'Entry: Evaluated Input (cfg_entry)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1).src_exbranch = substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{2}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1).sname = 'Files: NIfTI Images (cfg_files)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1).src_exbranch = substruct('.','val', '{}',{3}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{3}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1).sname = 'Files: MATLAB .mat Files (cfg_files)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1).src_exbranch = substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{4}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1).sname = 'Files: Any Files (cfg_files)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1).src_exbranch = substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{5}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1) = cfg_dep;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1).tname = 'Values Item';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1).tgt_spec = {};
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1).sname = 'Files: Directory (cfg_files)';
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1).src_exbranch = substruct('.','val', '{}',{6}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{6}(1).src_output = substruct('()',{1});
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.num = [0 Inf];
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.forcestruct = false;
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.check = [];
matlabbatch{7}.menu_cfg{1}.menu_struct{1}.conf_repeat.help = {'Assemble the set of input items for one run of the job.'};
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.type = 'cfg_repeat';
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.name = 'Runs';
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.tag = 'runs';
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1) = cfg_dep;
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).tname = 'Values Item';
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).tgt_spec = {};
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).sname = 'Repeat: Job Inputs (cfg_repeat)';
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).src_exbranch = substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.values{1}(1).src_output = substruct('()',{1});
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.num = [1 Inf];
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.forcestruct = false;
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.check = [];
matlabbatch{8}.menu_cfg{1}.menu_struct{1}.conf_repeat.help = {'Repeat "Job Inputs" for each run of the job, even if you want to specify no inputs in this batch itself. The number of "Job Inputs" items determines how often this job is run.'};
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'Job File(s)';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'jobs';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'batch';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.num = [1 Inf];
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'Select the job template(s). If multiple files are selected, they will be concatenated in selection order to form one job.'};
matlabbatch{9}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.type = 'cfg_const';
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.name = 'Don''t Save';
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.tag = 'dontsave';
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.val{1} = false;
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.check = [];
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.help = {'Do not save the generated jobs.'};
matlabbatch{10}.menu_cfg{1}.menu_entry{1}.conf_const.def = [];
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.type = 'cfg_entry';
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.name = 'Batch Filename Stub';
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.tag = 'outstub';
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.strtype = 's';
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.extras = [];
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.num = [1 Inf];
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.check = [];
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.help = {'The output filename will be generated by appending a job counter to this string.'};
matlabbatch{11}.menu_cfg{1}.menu_entry{1}.conf_entry.def = [];
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.type = 'cfg_files';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.name = 'Batch Directory';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.tag = 'outdir';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.filter = 'dir';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.ufilter = '.*';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.dir = '';
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.num = [1 1];
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.check = [];
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.help = {'The generated batches will be saved into this folder.'};
matlabbatch{12}.menu_cfg{1}.menu_entry{1}.conf_files.def = [];
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.type = 'cfg_branch';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.name = 'Save';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.tag = 'savejobs';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1) = cfg_dep;
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1).tname = 'Val Item';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1).tgt_spec = {};
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1).sname = 'Batch Filename Stub (cfg_entry)';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1).src_exbranch = substruct('.','val', '{}',{11}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{1}(1).src_output = substruct('()',{1});
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1) = cfg_dep;
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1).tname = 'Val Item';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1).tgt_spec = {};
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1).sname = 'Batch Directory (cfg_files)';
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1).src_exbranch = substruct('.','val', '{}',{12}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.val{2}(1).src_output = substruct('()',{1});
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.check = [];
matlabbatch{13}.menu_cfg{1}.menu_struct{1}.conf_branch.help = {'Specify filename stub and output directory to save the generated files.'};
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.type = 'cfg_choice';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.name = 'Save Generated Batch Jobs';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.tag = 'save';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1) = cfg_dep;
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1).tname = 'Values Item';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1).tgt_spec = {};
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1).sname = 'Save (cfg_branch)';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1).src_exbranch = substruct('.','val', '{}',{13}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{1}(1).src_output = substruct('()',{1});
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1) = cfg_dep;
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1).tname = 'Values Item';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1).tgt_spec = {};
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1).sname = 'Don''t Save (cfg_const)';
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1).src_exbranch = substruct('.','val', '{}',{10}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.values{2}(1).src_output = substruct('()',{1});
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.check = [];
matlabbatch{14}.menu_cfg{1}.menu_struct{1}.conf_choice.help = {'The generated batch jobs can be saved for reference or debugging purposes.'};
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.type = 'cfg_menu';
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.name = 'Missing Inputs';
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.tag = 'missing';
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.labels = {
                                                              'Skip jobs with missing inputs, run filled jobs'
                                                              'Don''t run any jobs if missing inputs'
}';
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.values = {
                                                              'skip'
                                                              'error'
}';
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.check = [];
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.help = {'Jobs with missing inputs (e.g. because of wrong input contents) can be skipped, while filled jobs are run. Alternatively, if any job has missing inputs, no jobs are run.'};
matlabbatch{15}.menu_cfg{1}.menu_entry{1}.conf_menu.def = [];
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.type = 'cfg_exbranch';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.name = 'Run Batch Jobs';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.tag = 'runjobs';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1) = cfg_dep;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1).tname = 'Val Item';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1).tgt_spec = {};
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1).sname = 'Job File(s) (cfg_files)';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1).src_exbranch = substruct('.','val', '{}',{9}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{1}(1).src_output = substruct('()',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1) = cfg_dep;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1).tname = 'Val Item';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1).tgt_spec = {};
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1).sname = 'Runs (cfg_repeat)';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1).src_exbranch = substruct('.','val', '{}',{8}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{2}(1).src_output = substruct('()',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1) = cfg_dep;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1).tname = 'Val Item';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1).tgt_spec = {};
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1).sname = 'Save Generated Batch Jobs (cfg_choice)';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1).src_exbranch = substruct('.','val', '{}',{14}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{3}(1).src_output = substruct('()',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1) = cfg_dep;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1).tname = 'Val Item';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1).tgt_spec = {};
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1).sname = 'Missing Inputs (cfg_menu)';
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1).src_exbranch = substruct('.','val', '{}',{15}, '.','val', '{}',{1}, '.','val', '{}',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.val{4}(1).src_output = substruct('()',{1});
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.prog = @cfg_run_runjobs;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.vout = @cfg_vout_runjobs;
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.check = [];
matlabbatch{16}.menu_cfg{1}.menu_struct{1}.conf_exbranch.help = {'Load a set of job files, fill missing inputs and run the filled job. This automates the creation and execution of batch jobs for a large number of identical computations.'};


function batch_fuse_atlas_seg_new(pcDirName,atlasDirName,registeredDirLoc)
%
% batch_fuse_atlas_seg.m
%
% This script fuses atlas segmentations.
%
% INPUTS: pcDirName - directory containing the PC representations in CERR format.
%       : atlasDirName - directory containing the atlas of CERR files
%       : registeredDirLoc - directory to write out the registrations and
%       to generate the atlas segmented results
%
% APA, 8/14/2018

% % directory containing all files
% pcDirName = 'H:\Public\Aditya\mimExtensions\CERR_files_Sandra_contours_PC';
% pcDirName = 'H:\Public\Aditya\mimExtensions\CERR_files_Sandra_contours_CT';
% pcDirName = 'H:\Public\Aditya\mimExtensions\Atlas_Sanne\PC_cerr';
% % pcDirName = 'H:\Public\Aditya\mimExtensions\Atlas_Sanne\CT_cropped_cerr';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/PC_cerr';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/CT_cropped_cerr';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/PC';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/PengAtlas/PC_all';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/SanneAtlas/PC_all';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/hnAtlasDec2017/PC/test';
% pcDirName = '/lab/deasylab1/Aditya/AtlasSeg/ProspectiveEval/PC/test';
%
% atlasDirName = '/lab/deasylab1/Aditya/AtlasSeg/PengAtlas/PC_atlas';
% atlasDirName = '/lab/deasylab1/Aditya/AtlasSeg/hnAtlasDec2017/PC/train';
%
% % directory for writing the registered files (must have \ or / as last character)
% % registeredDir = 'H:\Public\Aditya\mimExtensions\registered_to_ROBINSON^HEATH_35487047\';
% % registeredDir = 'H:\Public\Aditya\mimExtensions\registered_to_ROBINSON^HEATH_35487047_CT\';
% % registeredDir = 'H:\Public\Aditya\mimExtensions\registered_to_MT160_PC\';
% % registeredDir = 'H:\Public\Aditya\mimExtensions\registered_to_MT160_CT\';
%
% registeredDirLoc = 'H:\Public\Aditya\mimExtensions\registered\';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/registered_PC/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/registered_PC_25pts/';
% % registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/registered_CT_cropped/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/registered_CT_cropped_25_pts/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/registered_PC/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/PengAtlas/registered_PC_all_loocv/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/SanneAtlas/registered_PC_all_loocv/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/hnAtlasDec2017/PC/registered_test/';
% registeredDirLoc = '/lab/deasylab1/Aditya/AtlasSeg/ProspectiveEval/PC/registered_test/';

%distcomp.feature( 'LocalUseMpiexec', false )
%pool = parpool(15);

% atlas scans
atlasDirS = dir(atlasDirName);
atlasDirS(1:2) = [];
movScanC = fullfile(atlasDirName,{atlasDirS.name});

dirS = dir(pcDirName);
dirS(1:2) = [];

for indBase = 1:length(dirS)

    %     registeredDir = fullfile(registeredDirLoc,['registered_to_',...
    %         strtok(dirS(indBase).name,'.mat')]);
    [~,fname] = fileparts(dirS(indBase).name);
    registeredDir = fullfile(registeredDirLoc,['registered_to_',fname]);

    % mkdir(registeredDir)

    % base scan file name
    % indBase = baseScanNum; %9 for Sandra's atlas, 3 for Sanne's
    baseScan = fullfile(pcDirName,dirS(indBase).name);

    % Leave-one-out validation file list creation
    % % moving scan file names
    %indV = 1:length(dirS);
    %indV(indBase) = [];
    %movScanC = fullfile(pcDirName,{dirS(indV).name});
    % % Leave-one-out validation file list creation ends

    % Non-LOOCV validation
    dirPatS = dir(registeredDir);
    dirPatS(1:2) = [];
    movScanC = fullfile(registeredDir,{dirPatS(:).name});

    % registration callback
    strNameToWarp = 'Parotid_L_SvD';
    % registerToAtlas(baseScan,movScanC,registeredDir,strNameToWarp)
    %registerToAtlasMultipleScans(baseScan,movScanC,registeredDir,strNameToWarp)
    segStrNamC = {'Parotid_LT_BABS','Parotid_RT_BABS'};

    %%% ---------- Fuse results from multiple atlases
    numScans = 1;
    numStructs = 2;
    structNumV = 1:numScans*numStructs; % structures on all comps
    % structNumV = 1:6; % comment for structures on all comps
    planC = loadPlanC(baseScan,tempdir);
    indexS = planC{end};
    for structNum = 1:numStructs %structNumV
        % combine using the STAPLE and the GRE metric
        regDirS = dir(registeredDir);
        regDirS(1:2) = [];
        regFilesC = fullfile(registeredDir,{regDirS.name});
        %structNum = 2; % used for just one component atlas
        doseNum = 1;
        scanNum = 1;
        numAtlases = length(regFilesC);
        uniScanSiz = getUniformScanSize(planC{indexS.scan}(scanNum));
        strAllM = zeros(prod(uniScanSiz),numAtlases,'single');

        structNumOffset = 3*numStructs; % CT + 2 PC scans
        structNumOffset = numStructs; % Only CT
        parfor i = 1:numAtlases
            for scanNum = 1:numScans
                regPlanC = loadPlanC(regFilesC{i},tempdir);
                str3M = getUniformStr(structNum+numStructs*(scanNum-1)+structNumOffset,regPlanC);
                strAllM(:,i) = str3M(:);
            end
        end

        % APA Commented this out on 7/13/2018
        % Remove outliers
        agreeV = sum(strAllM > 0,2);
        agree50V = agreeV > numAtlases*numScans/2;
        matchM = bsxfun(@xor,strAllM > 0,agree50V);
        numMatchV = sum(~matchM,1);
        p50 = quantile(numMatchV,0.1);
        noOutV = numMatchV > p50;
        %p15 = quantile(numVoxelsV,0.15);
        %p85 = quantile(numVoxelsV,0.85);
        %noOutV = numVoxelsV > p15 & numVoxelsV < p85;
        %noOutV = true(1,size(strAllM,2)); % APA added 7/13/2018

        %confidenceV = linspace(0.3,0.6,4);
        confidenceV = 0.5;
        numConf = length(confidenceV);

        % Average agreement with and without outliers
        meanAgreeV = mean(strAllM > 0, 2);

        meanAgreeAfterOutRemV = mean(strAllM(:,noOutV) > 0, 2);

        % Structure Name
        structName = planC{indexS.structures}(structNum).structureName;
        newStrNam = segStrNamC{structNum};

        for iConf = 1:numConf
            confidence = confidenceV(iConf);
            isUniform = 1;
            scanNum = 1;

            % Majority Vote
            majVote3M = reshape(meanAgreeAfterOutRemV >= confidence, uniScanSiz);
            %newStrNam = [structName,'_MjV_',num2str(confidence*100)]
            planC = maskToCERRStructure(majVote3M,isUniform,scanNum,...
                newStrNam,planC);
            planC = deleteStructureSegments(length(planC{indexS.structures}),...
                0.05,planC);
            planC = smoothContour(length(planC{indexS.structures}),planC);

        end % end of staple-confidence loop

    end % end of loop over structNumv

    % Save planC
    outputFileNam = fullfile(registeredDir,dirS(indBase).name);
    save_planC(planC,[],'passed',outputFileNam);

end

function planC = smoothContour(structNum,planC)
indexS = planC{end};
for slc = 1:length(planC{indexS.structures}(structNum).contour)
    for seg = 1:length(planC{indexS.structures}(structNum).contour(slc).segments)
        ptsM = planC{indexS.structures}(structNum).contour(slc).segments(seg).points;
        if isempty(ptsM)
            continue;
        end
        numPts = size(ptsM,1);
        intrvl = ceil(numPts*0.2/10);
        pts1M = spcrv(ptsM(1:intrvl:end,1:2)',3,100)';
        pts1M(:,3) = ptsM(1,3)*pts1M(:,1).^0;
        pts1M(end+1,:) = pts1M(1,:);
        planC{indexS.structures}(structNum).contour(slc).segments(seg).points = pts1M;
    end
end
planC = getRasterSegs(planC, structNum);


function mrSetRadioButton(buttonNum,buttonIdList)
%mrSetRadioButton(buttonNum,buttonIdList)
%
%Sets (highlights) one radio button and turns other off
%
%bttonNum:  button number in list to turn on
%buttonIdList:  array of handles to radio buttons.

%7/30/97 gmb  Wrote it.

for i=1:length(buttonIdList)
  if buttonNum == i
    set(buttonIdList(i),'Value',1);
  else
    set(buttonIdList(i),'Value',0);
  end
end


  function isave = iter_saver(isave, niter)
%|function isave = iter_saver(isave, niter)
%| process 'isave' and 'niter' options of iterative algorithms
%| supporting char options 'all' and 'last' (default if empty)

if nargin < 2, ir_usage, end

persistent warned
if ~isvar('warned') || isempty(warned)
	warned = false;
end

if isempty(isave)
	if ~warned
		warn 'using default isave "last"'
		warned = 1;
	end
	isave = 'last';
end

if streq(isave, 'last')
	isave = niter;
elseif streq(isave, 'all')
	isave = 0:niter;
end

if any(isave < 0) || any(isave > niter)
	pr isave
	pr niter
	fail('bad isave')
end


function view = initHiddenFlat(subdir, dataType, scan, roi)
%
%  hiddenFlat = initHiddenFlat([subdir], [dataType, scan, roi])
%
% subdir: string specifying the flat subdirectory
%
% dataType: name or index # of selected data type (defaults to 'Original')
%
% scan: selected scan. [defaults to 1]
%
% roi: ROIs to load -- can be the name of an ROI file, or cell array of
% names. [default: don't load any ROIs.]
%
% djh, sometime in 1999
% ras, 04/05, set name to 'hidden'
% ras, 05/05, added curScan field
% ras, 01/10, added data type, scan, roi args to bring it in line with
% initHiddenInplane/Gray code; evaluates mrGlobals and loadSession to make
% sure we're in the right session; makes dummy fields for UI data, so code
% like publishFigure works.
if ~exist('dataType','var') | isempty(dataType)
    dataType = 1;
end

if ~exist('scan','var') | isempty(scan)
    scan = 1;
end

disp('Initializing HIDDEN Flat view')

evalin('base','mrGlobals');
evalin('base','HOMEDIR = pwd;');
evalin('base','loadSession');

% Set viewType
view.name='hidden';
view.viewType='Flat';

% Prompt user for flat subdirectory
if ~exist('subdir','var')
    subdir = getFlatSubdir;
end
view.subdir = subdir;

% Initialize slots for co, amp, and ph
view.co = [];
view.amp = [];
view.ph = [];
view.map = [];
view.mapName = '';
view.mapUnits = '';

% Initialize slots for tSeries
view.tSeries = [];
view.tSeriesScan = NaN;
view.tSeriesSlice = NaN;

% Initialize ROIs
view.ROIs = [];
view.selectedROI = 0;

% Initialize curDataType
if isnumeric(dataType),
    view.curDataType = dataType;
elseif ischar(dataType),
    view.curDataType = existDataType(dataType);
end

% Initialize curScan
view.curScan = scan;

% Compute/load coords
view = getFlatCoords(view);

% load the anatomy
view = loadAnat(view);

% set up UI fields, which allow us to perform most of the visualization
% code (such as publishFigure) on this hidden view as we could with a
% non-hidden view. If we don't do these steps, a lot of functions won't
% work on the hidden view.
if exist( fullfile(viewDir(view), 'userPrefs.mat'), 'file' )
	view = loadPrefs(view);

	% one caveat: the saved preferences may specify a data type and scan
	% other than the one the user provided to this function. If so, go with
	% the one the user input.
	view.curScan = scan;
	if isnumeric(dataType),
		view.curDataType = dataType;
	elseif ischar(dataType),
		view.curDataType = existDataType(dataType);
	end
else
	if prefsVerboseCheck >= 1
		fprintf('[%s]: No user prefs found for %s.', mfilename, pwd);
	end
	view.ui.showROIs = -2; % show all ROIs by default
end
view.ui.imSize = [size(view.anat, 1) size(view.anat, 2)];
view = makeFlatMask(view);

% load any ROIs specified
if exist('roi','var') & ~isempty(roi)
    view = loadROI(view,roi);
end

return;


function imageData = DMdicomread(fileName_or_metaHeader)
    % DMdicomread Reads image data from a Dicom file
    %
    % Usage:
    %     imageData = DMdicomread(fileName)
    %         fileName: path and filename of the file to test
    %
    %     imageData = DMdicomread(metaheader)
    %         metaheader: structure returned from DMdicominfo
    %
    %  Returns:
    %     The pixel data
    %
    %
    %
    %     Licence
    %     -------
    %     Part of DicoMat. https://github.com/tomdoel/dicomat
    %     Author: Tom Doel, 2013.  www.tomdoel.com
    %     Distributed under the BSD 3-Clause license. Please see the file LICENSE for details.
    %

    if isstruct(fileName_or_metaHeader)
        fileName = fileName_or_metaHeader.Filename;
    else
        fileName = fileName_or_metaHeader;
    end

    header = DMReadDicomTags(fileName, DMDicomDictionary.EssentialDictionary);
    if isfield(header, 'PixelData')
        imageData = header.PixelData;
    else
        imageData = [];
    end
end


function camera_info = readCameraInfo(filename)

file_words=file2cellarray(filename);

camera_info = [];

for iline=1:length(file_words)
    switch(file_words{iline}{1})
        case('camera_number:')
            fprintf('camera_number: %s\n',file_words{iline}{2});
        case('camera_index:')
            camera_info(end+1).camera_index = str2num(file_words{iline}{2});
        case('')
        otherwise
            value = str2double(file_words{iline}{2});
            if isnan(value)
                value = file_words{iline}{2};
            end
            camera_info(end).(file_words{iline}{1}(1:end-1)) = value;
    end
end


%SETVERSION Set the version field of a dataset
%
%   A = SETVERSION(A,S)
%
% INPUT
%   A      Dataset
%   S      String to be stored in the version field
%
% OUTPUT
%   A      Updated dataset
%
% DESCRIPTION
% Set or reset the version field of A by S.


function template = PTKCreateTemplateForLobe(lobe_mask, context, reporting)
    % PTKCreateTemplateForLobe. Function for creating a template image
    %     for a lobar regon
    %
    %     Licence
    %     -------
    %     Part of the TD Pulmonary Toolkit. https://github.com/tomdoel/pulmonarytoolkit
    %     Author: Tom Doel, 2013.  www.tomdoel.com
    %     Distributed under the GNU GPL v3 licence. Please see website for details.
    %

    template = lobe_mask.Copy;
end


function toolboxGenDoc
% Generate documentation, must run from dir toolbox.
%
% 1) Make sure to update and run toolboxUpdateHeader.m
% 2) Update history.txt appropriately, including w current version
% 3) Update overview.html file with the version/data/link to zip:
%     edit external/m2html/templates/frame-piotr/overview.html
%
% USAGE
%  toolboxGenDoc
%
% INPUTS
%
% OUTPUTS
%
% EXAMPLE
%
% See also
%
% Piotr's Image&Video Toolbox      Version 3.10
% Copyright 2012 Piotr Dollar.  [pdollar-at-caltech.edu]
% Please email me if you find bugs, or have suggestions or questions!
% Licensed under the Simplified BSD License [see external/bsd.txt]

% Requires external/m2html to be in path.
cd(fileparts(mfilename('fullpath'))); cd('../');
addpath([pwd '/external/m2html']);

% delete temporary files that should not be part of release
fs={'pngreadc','pngwritec','rjpg8c','wjpg8c'};
for i=1:length(fs), delete(['images/private/' fs{i} '.*']); end

% delete old doc and run m2html
if(exist('doc/','dir')), rmdir('doc/','s'); end
dirs={'channels','classify','images','filters','matlab'};
m2html('mfiles',dirs,'htmldir','doc','recursive','on','source','off',...
  'template','frame-piotr','index','menu','global','on');

% copy custom menu.html and history file
sDir='external/m2html/templates/';
copyfile([sDir 'menu-for-frame-piotr.html'],'doc/menu.html');
copyfile('external/history.txt','doc/history.txt');

% remove links to private/ in the menu.html files and remove private/ dirs
for i=1:length(dirs)
  name = ['doc/' dirs{i} '/menu.html'];
  fid=fopen(name,'r'); c=fread(fid,'*char')'; fclose(fid);
  c=regexprep(c,'
([^<]*[<]?[^<]*)private([^<]*[<]?[^<]*)
','');
  fid=fopen(name,'w'); fwrite(fid,c); fclose(fid);
  name = ['doc/' dirs{i} '/private/'];
  if(exist(name,'dir')), rmdir(name,'s'); end
end

% postprocess each html file
for d=1:length(dirs)
  fs=dir(['doc/' dirs{d} '/*.html']); fs={fs.name};
  for j=1:length(fs), postProcess(['doc/' dirs{d} '/' fs{j}]); end
end

end

function postProcess( fName )
lines=readFile(fName);
assert(strcmp(lines{end-1},'') && strcmp(lines{end},''));
% remove m2html datestamp (if present)
assert(strcmp(lines{end-2}(1:22),'
<address>Generated'));
if( strcmp(lines{end-2}(1:25),'
<address>Generated on'))
  lines{end-2}=regexprep(lines{end-2}, ...
    '
<address>Generated on .* by','
<address>Generated by');
end
% insert Google Analytics snippet to end of file
ga={ '';
  '';
  '';
  '';
  '';
  '' };
lines = [lines(1:end-3); ga; lines(end-2:end)];
% write file
writeFile( fName, lines );
end

function lines = readFile( fName )
fid = fopen( fName, 'rt' ); assert(fid~=-1);
lines=cell(10000,1); n=0;
while( 1 )
  n=n+1; lines{n}=fgetl(fid);
  if( ~ischar(lines{n}) ), break; end
end
fclose(fid); n=n-1; lines=lines(1:n);
end

function writeFile( fName, lines )
fid = fopen( fName, 'wt' );
for i=1:length(lines); fprintf( fid, '%s\n', lines{i} ); end
fclose(fid);
end


function lpcb
global lowpass hlp

if get(hlp,'value')
    lowpass=true;
else
    lowpass=false;
end


function file_list=get_file_list(directory)
%file_list=get_file_list(directory)
%returns a filelist cell{}, if no directory is given, '.' is used.
if nargin<1
  directory='.';
end

f_struct=dir(directory);
file_list={};
j=1;
for i=1:length(f_struct)
  if ~strcmp(f_struct(i).name, '.') & ~strcmp(f_struct(i).name, ...
					      '..') & ~strcmp(f_struct(i).name, '.svn')
    file_list{j}=f_struct(i).name;
    j=j+1;
  end %if
end %for i
end


function extras = write_extras(fname,extras)
% Write extra bits of information
%_______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

%
% $Id: write_extras.m 1143 2008-02-07 19:33:33Z spm $

[pth,nam,ext] = fileparts(fname);
switch ext
case {'.hdr','.img','.nii'}
    mname = fullfile(pth,[nam '.mat']);
case {'.HDR','.IMG','.NII'}
    mname = fullfile(pth,[nam '.MAT']);
otherwise
    mname = fullfile(pth,[nam '.mat']);
end
if isstruct(extras) && ~isempty(fieldnames(extras)),
    savefields(mname,extras);
end;

function savefields(fnam,p)
if length(p)>1, error('Can''t save fields.'); end;
fn = fieldnames(p);
for i_=1:length(fn),
    eval([fn{i_} '= p.' fn{i_} ';']);
end;
if str2num(version('-release'))>=14,
    fn = {'-V6',fn{:}};
end;
if numel(fn)>0,
    save(fnam,fn{:});
end;
return;


%kkgenman 'kgenman: generate man3 pages from source code headers'
% This MatLab function was automatically generated by a converter (KhorosToMatLab) from the Khoros kgenman.pane file
%
% Parameters:
% String: tb 'Toolbox Name', default: ' ': 'toolbox the library belongs to'
% String: lib 'Library Name', default: ' ': 'library to generate man pages for'
% String: section 'Man Section', default: ' ': 'Man section to put the man page into'
% String: dir 'Generate man pages and install', default: '.': 'generate and install in the directory specified'
% Toggle: install 'Generate and install the man pages in $TOOLBOX/man/man3', default: 0: 'Install the man pages in $TOOLBOX/man/man3'
% Toggle: list 'List Man Pages Only', default: 0: 'List the man pages rather than generate them'
% Toggle: all 'All src files in library object', default: 0: 'create man pages for all src in the library object'
% String: i 'Input Source Code File', default: ' ': 'input source code file'
%
% Example: kkgenman( {'tb',' ';'lib',' ';'section',' ';'dir','.';'install',0;'list',0;'all',0;'i',' '})
%
% Khoros helpfile follows below:
%
%  PROGRAM
% kgenman - generate man page(s) for a software object
%
%  DESCRIPTION
%
% This program parses a khoros public routine header for information, and
% generates a man 3 page for the public library routine.  This routine takes a
% as input the library object the user wants man 3 pages for, and creates all
% the man 3 files for every public routine in a single file, or in the whole
% library.  It then installs the man page in the directory of choice, or
% the final installation directory in $TOOLBOX/man/object_name/man.
%
% Note, all the information stored between the lines ".SH ADDITIONAL INFO" and
% ".SH SIDE EFFECTS" is saved and propagated to the new man page.  Thus,
% the user can put extra information in this section of the man page, such as an
% example section, if desired.
%
% This program will detect when headers have missing fields, and recover
% gracefully.  If a field is missing, it will indicate which field, routine,
% and filename the error occurred in, and continue on with that field left
% empty.  Therefore, it is the programmers responsibility to fix the header,
% and re-run kgenman on that file, so that the man page will be complete.
%
% The example field below has an example of the public header along with an
% explaination of each field that goes in it.
%
%
%
%  EXAMPLES
%
%  "SEE ALSO"
%
%  RESTRICTIONS
%
%  REFERENCES
%
%  COPYRIGHT
% Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI")  All rights reserved.
%

function varargout = kkgenman(varargin)
Inputs={};
if nargin ==0
  arglist={'',''};
elseif nargin ==1
  arglist=varargin{1};
else error('Usage: [out1,..] = kkgenman(arglist).');
end
if size(arglist,2)~=2
  error('arglist must be of form {''ParameterTag1'',value1;''ParameterTag2'',value2}')
 end
narglist={'tb', ' ';'lib', ' ';'section', ' ';'dir', '.';'install', 0;'list', 0;'all', 0;'i', ' '};
maxval={0,0,0,0,0,0,0,0};
minval={0,0,0,0,0,0,0,0};
istoggle=[0,0,1,1,1,1,1,1];
was_set=istoggle * 0;
paramtype={'String','String','String','String','Toggle','Toggle','Toggle','String'};
% identify the input arrays and assign them to the arguments as stated by the user
if ~iscell(Inputs)
Inputs = {Inputs};
end
NumReqOutputs=0; nextinput=1; nextoutput=1;
  for ii=1:size(arglist,1)
  wasmatched=0;
  for jj=1:size(narglist,1)
   if strcmp(arglist{ii,1},narglist{jj,1})  % a given argument was matched to the possible arguments
     wasmatched = 1;
     was_set(jj) = 1;
     if strcmp(narglist{jj,2}, '__input')
      if (nextinput > length(Inputs))
        error(['Input ' narglist{jj,1} ' has no corresponding input!']);
      end
      narglist{jj,2} = 'OK_in';
      nextinput = nextinput + 1;
     elseif strcmp(narglist{jj,2}, '__output')
      if (nextoutput > nargout)
        error(['Output nr. ' narglist{jj,1} ' is not present in the assignment list of outputs !']);
      end
      if (isempty(arglist{ii,2}))
        narglist{jj,2} = 'OK_out';
      else
        narglist{jj,2} = arglist{ii,2};
      end

      nextoutput = nextoutput + 1;
      if (minval{jj} == 0)
         NumReqOutputs = NumReqOutputs - 1;
      end
     elseif isstr(arglist{ii,2})
      narglist{jj,2} = arglist{ii,2};
     else
        if strcmp(paramtype{jj}, 'Integer') & (round(arglist{ii,2}) ~= arglist{ii,2})
            error(['Argument ' arglist{ii,1} ' is of integer type but non-integer number ' arglist{ii,2} ' was supplied']);
        end
        if (minval{jj} ~= 0 | maxval{jj} ~= 0)
          if (minval{jj} == 1 & maxval{jj} == 1 & arglist{ii,2} < 0)
            error(['Argument ' arglist{ii,1} ' must be bigger or equal to zero!']);
          elseif (minval{jj} == -1 & maxval{jj} == -1 & arglist{ii,2} > 0)
            error(['Argument ' arglist{ii,1} ' must be smaller or equal to zero!']);
          elseif (minval{jj} == 2 & maxval{jj} == 2 & arglist{ii,2} <= 0)
            error(['Argument ' arglist{ii,1} ' must be bigger than zero!']);
          elseif (minval{jj} == -2 & maxval{jj} == -2 & arglist{ii,2} >= 0)
            error(['Argument ' arglist{ii,1} ' must be smaller than zero!']);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} < minval{jj})
            error(['Argument ' arglist{ii,1} ' must be bigger than ' num2str(minval{jj})]);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} > maxval{jj})
            error(['Argument ' arglist{ii,1} ' must be smaller than ' num2str(maxval{jj})]);
          end
        end
     end
     if ~strcmp(narglist{jj,2},'OK_out') &  ~strcmp(narglist{jj,2},'OK_in')
       narglist{jj,2} = arglist{ii,2};
     end
   end
   end
   if (wasmatched == 0 & ~strcmp(arglist{ii,1},''))
        error(['Argument ' arglist{ii,1} ' is not a valid argument for this function']);
   end
end
% match the remaining inputs/outputs to the unused arguments and test for missing required inputs
 for jj=1:size(narglist,1)
     if  strcmp(paramtype{jj}, 'Toggle')
        if (narglist{jj,2} ==0)
          narglist{jj,1} = '';
        end;
        narglist{jj,2} = '';
     end;
     if  ~strcmp(narglist{jj,2},'__input') && ~strcmp(narglist{jj,2},'__output') && istoggle(jj) && ~ was_set(jj)
          narglist{jj,1} = '';
          narglist{jj,2} = '';
     end;
     if strcmp(narglist{jj,2}, '__input')
      if (minval{jj} == 0)  % meaning this input is required
        if (nextinput > size(Inputs))
           error(['Required input ' narglist{jj,1} ' has no corresponding input in the list!']);
        else
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        end
      else  % this is an optional input
        if (nextinput <= length(Inputs))
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end;
     else
     if strcmp(narglist{jj,2}, '__output')
      if (minval{jj} == 0) % this is a required output
        if (nextoutput > nargout & nargout > 1)
           error(['Required output ' narglist{jj,1} ' is not stated in the assignment list!']);
        else
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
          NumReqOutputs = NumReqOutputs-1;
        end
      else % this is an optional output
        if (nargout - nextoutput >= NumReqOutputs)
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end
     end
  end
end
if nargout
   varargout = cell(1,nargout);
else
  varargout = cell(0);
end
global KhorosRoot
if exist('KhorosRoot') && ~isempty(KhorosRoot)
w=['"' KhorosRoot];
else
if ispc
  w='"C:\Program Files\dip\khorosBin\';
else
[s,w] = system('which cantata');
w=['"' w(1:end-8)];
end
end
callKhoros([w 'kgenman"  '],Inputs,narglist);


%kkprdata 'Print Data in Formatted ASCII'
% This MatLab function was automatically generated by a converter (KhorosToMatLab) from the Khoros kprdata.pane file
%
% Parameters:
% InputFile: i 'Input ', required: 'Input Data Object'
% Toggle: attr 'Attributes', default: 0: 'Print Object Information & Attributes'
% Toggle: loc ' ', default: 0: 'Print Location Data'
% Toggle: time ' ', default: 0: 'Print Time Data'
% Toggle: val ' ', default: 0: 'Print Value Data'
% Toggle: mask ' ', default: 0: 'Print Mask Data'
% Toggle: ind ' ', default: 0: 'Print Implicit Indexing'
% String: replace 'Replacement for Masked Values', default: '*': 'Replacement String for Masked Values'
% OutputFile: f 'Output', optional: 'Resulting Output File'
% Toggle: mind ' ', default: 0: 'Print Implicit Map Indexing'
% Toggle: map ' ', default: 0: 'Print Map Data'
% Toggle: mval 'Map Value Data Through Map', default: 0: 'Map Value Data Through Map'
%
% Example: f = kkprdata(i, {'i','';'attr',0;'loc',0;'time',0;'val',0;'mask',0;'ind',0;'replace','*';'f','';'mind',0;'map',0;'mval',0})
%
% Khoros helpfile follows below:
%
%  PROGRAM
% kprdata - Print Data in Formatted ASCII
%
%  DESCRIPTION
% .I kprdata
% prints the selected segments of data from the input object in
% ASCII format to a file or to the screen.
%
% If the Print Attributes option (-att) is selected, all header and data
% information is printed before any data is printed.  (These non-data
% lines begin with a #, which indicates that the line is a "comment".)
%
% After the attribute lines, data fields selected by the user are formatted in
% the following order.
%
%
% Implicit Indexing: Location Data: Time Data: Value Data: Mask Data.
%
% This data can be followed by map data (if selected):
%
%
% Map Indexing: Map Data.
%
% This data can be followed by connectivity data.
%
% When map data exists, selecting the "Map Value Data Through Map" option
% will cause the value data to be mapped through the map data before being
% presented.
%
% The implicit indexing options, Print Implicit Indexing (-ind), and Print Map
% Indexing (-mind), if selected, will print the indices of the data.
% The index values index both the value data and explicit location and time
% data.  For instance, in the following example, the index [0][0][0][1]
% points to the 3D location data [4][27][38], and the value of 104.5.
%
%
% t  d  h  w    Location  Value
% 0  0  0  1    4 27 38   104.5
%
% The \fBReplacement for Masked Values" option (-replace) allows value data
% which has mask data associated with it, to be printed with the masked values
% replaced by the given string.
%
% Complex data is printed as real/imaginary pairs (real, imaginary).
%
% If data segments that do not exist in the input data object are selected,
% kprdata will return a warning message indicating that the segments do not
% exist.  Information about other selected segments will be printed.
%
% If the location grid is uniform or rectilinear and only the location
% data is being printed, then the location data will be printed in a
% manner consistent with the grid type.  That is, a uniform grid implies
% that the location begin and end will be printed, and a rectilinear
% grid implies that the data for the width, height, and depth axes will
% be printed.  When location data is printed with any other parts of the
% data model, it is presented as if it were curvilinear location data.
%
%
%
%  EXAMPLES
%
% kprdata -i in_object -attr -val -ind
% This command sequence will cause the attributes, followed by
% the value data, with indices, to be printed to stdout.
%
% kprdata -i in_obj -map -mind -val -f out_file
% This command sequence will print all of the value data,
% followed by the map data, with indices, to the file out_file.
%
%  "SEE ALSO"
%
%  RESTRICTIONS
%
%  REFERENCES
%
%  COPYRIGHT
% Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI")  All rights reserved.
%

function varargout = kkprdata(varargin)
if nargin ==0
  Inputs={};arglist={'',''};
elseif nargin ==1
  Inputs=varargin{1};arglist={'',''};
elseif nargin ==2
  Inputs=varargin{1}; arglist=varargin{2};
else error('Usage: [out1,..] = kkprdata(Inputs,arglist).');
end
if size(arglist,2)~=2
  error('arglist must be of form {''ParameterTag1'',value1;''ParameterTag2'',value2}')
 end
narglist={'i', '__input';'attr', 0;'loc', 0;'time', 0;'val', 0;'mask', 0;'ind', 0;'replace', '*';'f', '__output';'mind', 0;'map', 0;'mval', 0};
maxval={0,0,0,0,0,0,0,0,1,0,0,0};
minval={0,0,0,0,0,0,0,0,1,0,0,0};
istoggle=[0,1,1,1,1,1,1,1,1,1,1,1];
was_set=istoggle * 0;
paramtype={'InputFile','Toggle','Toggle','Toggle','Toggle','Toggle','Toggle','String','OutputFile','Toggle','Toggle','Toggle'};
% identify the input arrays and assign them to the arguments as stated by the user
if ~iscell(Inputs)
Inputs = {Inputs};
end
NumReqOutputs=0; nextinput=1; nextoutput=1;
  for ii=1:size(arglist,1)
  wasmatched=0;
  for jj=1:size(narglist,1)
   if strcmp(arglist{ii,1},narglist{jj,1})  % a given argument was matched to the possible arguments
     wasmatched = 1;
     was_set(jj) = 1;
     if strcmp(narglist{jj,2}, '__input')
      if (nextinput > length(Inputs))
        error(['Input ' narglist{jj,1} ' has no corresponding input!']);
      end
      narglist{jj,2} = 'OK_in';
      nextinput = nextinput + 1;
     elseif strcmp(narglist{jj,2}, '__output')
      if (nextoutput > nargout)
        error(['Output nr. ' narglist{jj,1} ' is not present in the assignment list of outputs !']);
      end
      if (isempty(arglist{ii,2}))
        narglist{jj,2} = 'OK_out';
      else
        narglist{jj,2} = arglist{ii,2};
      end

      nextoutput = nextoutput + 1;
      if (minval{jj} == 0)
         NumReqOutputs = NumReqOutputs - 1;
      end
     elseif isstr(arglist{ii,2})
      narglist{jj,2} = arglist{ii,2};
     else
        if strcmp(paramtype{jj}, 'Integer') & (round(arglist{ii,2}) ~= arglist{ii,2})
            error(['Argument ' arglist{ii,1} ' is of integer type but non-integer number ' arglist{ii,2} ' was supplied']);
        end
        if (minval{jj} ~= 0 | maxval{jj} ~= 0)
          if (minval{jj} == 1 & maxval{jj} == 1 & arglist{ii,2} < 0)
            error(['Argument ' arglist{ii,1} ' must be bigger or equal to zero!']);
          elseif (minval{jj} == -1 & maxval{jj} == -1 & arglist{ii,2} > 0)
            error(['Argument ' arglist{ii,1} ' must be smaller or equal to zero!']);
          elseif (minval{jj} == 2 & maxval{jj} == 2 & arglist{ii,2} <= 0)
            error(['Argument ' arglist{ii,1} ' must be bigger than zero!']);
          elseif (minval{jj} == -2 & maxval{jj} == -2 & arglist{ii,2} >= 0)
            error(['Argument ' arglist{ii,1} ' must be smaller than zero!']);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} < minval{jj})
            error(['Argument ' arglist{ii,1} ' must be bigger than ' num2str(minval{jj})]);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} > maxval{jj})
            error(['Argument ' arglist{ii,1} ' must be smaller than ' num2str(maxval{jj})]);
          end
        end
     end
     if ~strcmp(narglist{jj,2},'OK_out') &  ~strcmp(narglist{jj,2},'OK_in')
       narglist{jj,2} = arglist{ii,2};
     end
   end
   end
   if (wasmatched == 0 & ~strcmp(arglist{ii,1},''))
        error(['Argument ' arglist{ii,1} ' is not a valid argument for this function']);
   end
end
% match the remaining inputs/outputs to the unused arguments and test for missing required inputs
 for jj=1:size(narglist,1)
     if  strcmp(paramtype{jj}, 'Toggle')
        if (narglist{jj,2} ==0)
          narglist{jj,1} = '';
        end;
        narglist{jj,2} = '';
     end;
     if  ~strcmp(narglist{jj,2},'__input') && ~strcmp(narglist{jj,2},'__output') && istoggle(jj) && ~ was_set(jj)
          narglist{jj,1} = '';
          narglist{jj,2} = '';
     end;
     if strcmp(narglist{jj,2}, '__input')
      if (minval{jj} == 0)  % meaning this input is required
        if (nextinput > size(Inputs))
           error(['Required input ' narglist{jj,1} ' has no corresponding input in the list!']);
        else
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        end
      else  % this is an optional input
        if (nextinput <= length(Inputs))
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end;
     else
     if strcmp(narglist{jj,2}, '__output')
      if (minval{jj} == 0) % this is a required output
        if (nextoutput > nargout & nargout > 1)
           error(['Required output ' narglist{jj,1} ' is not stated in the assignment list!']);
        else
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
          NumReqOutputs = NumReqOutputs-1;
        end
      else % this is an optional output
        if (nargout - nextoutput >= NumReqOutputs)
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end
     end
  end
end
if nargout
   varargout = cell(1,nargout);
else
  varargout = cell(1,1);
end
global KhorosRoot
if exist('KhorosRoot') && ~isempty(KhorosRoot)
w=['"' KhorosRoot];
else
if ispc
  w='"C:\Program Files\dip\khorosBin\';
else
[s,w] = system('which cantata');
w=['"' w(1:end-8)];
end
end
[varargout{:}]=callKhoros([w 'kprdata"  '],Inputs,narglist);


% Function that clears all the wintx_i and winty_i
% In normal operation of the toolbox, this function should not be
% useful.
% only in cases where you want to re-extract corners using the Extract grid corners another time... not common. You might as well use the Recomp. corners.

for kk = 1:n_ima,

   eval(['clear wintx_' num2str(kk) ' winty_' num2str(kk)]);

end;


function res = viewHelpParameter(paramIn)
% Maps the paramIn to the help file, displaying an explanation of what each
% viewGet/Set parameter should do.
% This function should never
% be called directly, but is instead wrapped by viewMapParameterField.
%
%    res = viewHelpParameter(paramIn);
%
% Add help functionality for viewGet/Set.
%
% By using this function, we can get help from the program itself when
% trying to call a certain field. This embeds knowledge of what each field
% does into the program, rather than into people's heads.
%
% res returns a multi-line string that, when printed, will display across
% multiple lines, similar to the multi-line comments previously stored in
% the Matlab code.
%
% Examples:
%   viewHelpParameter('name')
%   viewHelpParameter('curdt')

global DictViewHelp;

if isempty(DictViewHelp)
    DictViewHelp = containers.Map;

    DictViewHelp('homedir') = ['Return full path to directory.' char(10) ...
        'homedir = viewGet(vw, ''Home Directory'');'];
    DictViewHelp('sessionname') = ['Retrun name of session, such as ''BW090616-8Bars-14deg''.' char(10) ...
        'sessionName = viewGet(vw, ''session name'');'];
    DictViewHelp('subject') = ['Return name of subject, such as ''Wandell''' char(10) ...
        'subject = viewGet(vw, ''subject'')'];
    DictViewHelp('name') = ['Return name of view, such as ''INPLANE{1}''' char(10) ...
        'name = viewGet(vw, ''view name'');'];
    DictViewHelp('annotation') = ['Return description of currently selected scan (string, such as' char(10) ...
        '''14 Deg 8 Bars with blanks'')' char(10) ...
        'annotation = viewGet(vw, ''annotation'');'];
    DictViewHelp('annotations') = ['Return a cell array with descriptions of each scan in current' char(10) ...
        'dataType' char(10) ...
        'annotations = viewGet(vw, ''annotations'');'];
    DictViewHelp('viewtype') = ['Return the view type (''Gray'', ''Volume'', ''Inplane'', ''Flat'', etc) ' char(10) ...
        'viewType = viewGet(vw, ''View Type'');'];
    DictViewHelp('subdir') = ['Return the sub directory name (not the full path) with data for' char(10) ...
        'current view ' char(10) ...
        'subdir = viewGet(vw, ''sub directory'');'];
    DictViewHelp('curscan') = ['Return the currently selected scan number' char(10) ...
        'curscan = viewget(vw, ''Current Scan'');'];
    DictViewHelp('curslice') = ['Return the current slice number. This is the actual slice number' char(10) ...
        'if we are in the Inplane view. It is the plane number (sag, cor,' char(10) ...
        'or axi) of the currently selected plane if we are in the Volume' char(10) ...
        'view. And it is 1 or 2 in the Flat view (for left or right).' char(10) ...
        'curslice = viewGet(vw, ''Current Slice'');'];
    DictViewHelp('nscans') = ['Return the number of scans in the currently selected dataTYPE' char(10) ...
        'nscans = viewGet(vw, ''Number of Scans'');'];
    DictViewHelp('nslices') = ['Return the number of slices in the current view struct' char(10) ...
        'nslices = viewGet(vw, ''Number of Slices'');'];
    DictViewHelp('montageslices') = ['Return the current subset of slices that are visible in the GUI.' char(10) ...
        'montageSlices = viewGet(vw, ''Montage Slices'');' char(10) ...
        '' char(10) ...
        'only for some view types: inplane montage, flat level' char(10) ...
        'Well, this seems not to be true since it returns a value in the' char(10) ...
        'Volume view.'];
    DictViewHelp('dtname') = ['Return the name of the currently selected dataTYPE' char(10) ...
        'dtName = viewGet(vw, ''Data TYPE Name'');' char(10) ...
        '' char(10) ...
        'ras 06/07: note that I ''stole'' the ''datatype'' alias from' char(10) ...
        'the dtnumber property: I think the name is more relevant'];
    DictViewHelp('curdt') = ['Return the number of the currently selected dataTYPE' char(10) ...
        'dtNum = viewGet(vw, ''Current Data TYPE'');'];
    DictViewHelp('dtstruct') = ['Return the currently selected dataTYPE struct' char(10) ...
        'dtStruct = viewGet(vw, ''DT struct'');       '];
    DictViewHelp('coherence') = ['Coherence for all voxels, all scans in current dataTYPE        ' char(10) ...
        'co = viewGet(vw, ''Coherence'');        '];
    DictViewHelp('scanco') = ['Coherence for single scan' char(10) ...
        'scanco = viewGet(vw, ''scan coherence'', 1);        '];
    DictViewHelp('phase') = ['Phase for all voxels, all scans in current dataTYPE    ' char(10) ...
        'ph = viewGet(vw, ''Phase'');'];
    DictViewHelp('scanph') = ['Phase values for single scan' char(10) ...
        'viewGet(vw,''Scan Phase'',1);'];
    DictViewHelp('amplitude') = ['Amplitude for all voxels, all scans in current dataTYPE    ' char(10) ...
        'amp = viewGet(vw, ''Amplitude'');'];
    DictViewHelp('scanamp') = ['Amplitude values for single scan (selected scan or specified' char(10) ...
        'scan).' char(10) ...
        'scan = 1; scanAmp = viewGet(vw,''scan Amp'', scan);' char(10) ...
        'scanAmp = viewGet(vw,''scan Amp'');'];
    DictViewHelp('refph') = ['Return the reference phase used for computing phase-referred' char(10) ...
        'coherence. Should be [0 2*pi]?' char(10) ...
        'refph = viewGet(vw,''reference phase'');'];
    DictViewHelp('ampmap') = ['Return the colormap currently used to display amplutitude data.' char(10) ...
        'Should be 3 x numColors.' char(10) ...
        'ampMap = viewGet(vw, ''amplitude color map'');'];
    DictViewHelp('coherencemap') = ['Return the colormap currently used to display coherence data.' char(10) ...
        'Should be 3 x numColors.' char(10) ...
        'cohMap = viewGet(vw, ''coherence color map'');'];
    DictViewHelp('correlationmap') = ['Return the colormap currently used to display correlation data.' char(10) ...
        'Should be 3 x numColors. ' char(10) ...
        'corMap = viewGet(vw, ''correlation color map'');' char(10) ...
        '' char(10) ...
        '[Q: what is a correlation map and how does it differ from' char(10) ...
        'coherence map?]'];
    DictViewHelp('cothresh') = ['Return the coherence threshold. Should be in [0 1].' char(10) ...
        'cothresh = viewGet(vw, ''Coherence Threshold'');'];
    DictViewHelp('phwin') = ['Return  phWindow values from phWindow sliders (non-hidden views)' char(10) ...
        'or from the view.settings.phWin field (hidden views). If can''t' char(10) ...
        'find either, defaults to [0 2*pi].' char(10) ...
        'phwin = viewGet(vw, ''phase window'');'];
    DictViewHelp('twparams') = ['Return travelling wave parameters.' char(10) ...
        'twparams = viewGet(vw, ''Travelling Wave Parameters'');        '];
    DictViewHelp('cmap') = ['Return the colormap for whichever data view (co, ph, amp, map) is' char(10) ...
        'currently selected.' char(10) ...
        'cmap = viewGet(vw, ''color map'');'];
    DictViewHelp('cmapcolor') = ['Return color portion of current color overlay map.' char(10) ...
        'cmapColor = viewGet(vw, ''cmap color'');'];
    DictViewHelp('cmapgrayscale') = ['Return grayscale portion of current color overlay map' char(10) ...
        'cmapGray = viewGet(vw, ''cmap grayscale'');'];
    DictViewHelp('map') = ['Return the parameter map for the current data type. Map is cell' char(10) ...
        'array 1 x nscans.' char(10) ...
        'map = viewGet(vw, ''map'');'];
    DictViewHelp('mapwin') = ['Return mapWindow values from mapWindow sliders (non-hidden views)' char(10) ...
        'or from the view.settings.mapWin field (hidden views).        ' char(10) ...
        'mapWin = viewGet(vw, ''Map Window'');'];
    DictViewHelp('mapname') = ['Return the name of the current paramter map (string), e.g.,' char(10) ...
        '''eccentricty''. ' char(10) ...
        'mapName = viewGet(vw, ''Map Name'');'];
    DictViewHelp('mapunits') = ['Return the map units for the current paramter map (string), e.g.,' char(10) ...
        '''degrees''. The map units are for display only; they are not used' char(10) ...
        'for calculations.' char(10) ...
        'mapUnits = viewGet(vw, ''Map Units'');'];
    DictViewHelp('mapclip') = ['Return map clip values. These are the clip values for the' char(10) ...
        'colorbar. They are not the clip values in the slider (which are' char(10) ...
        'called ''mapwin''). Values outside of mapclip are colored the same' char(10) ...
        'as the minimum or maximum value according to the color lookup' char(10) ...
        'table. Values outside of mapwin are not shown at all.' char(10) ...
        'mapClip = viewGet(vw, ''Map Window'');'];
    DictViewHelp('scanmap') = ['Return the parameter map for the currently selected or the' char(10) ...
        'specified scan.' char(10) ...
        'scanMap = viewGet(vw, ''scan map'')' char(10) ...
        'scan = 1; scanMap = viewGet(vw, ''scan map'', scan);'];
    DictViewHelp('anatomy') = ['Return the anatomical underlay image.'];
    DictViewHelp('anatomymap') = ['Return the colormap for the anatomical underlay image.' char(10) ...
        'anataomyMap = viewGet(vw, ''Anatomy Map'');'];
    DictViewHelp('anatomynifti') = ['Return the actual nifti struct stored in anat'];
    DictViewHelp('anatclip') = ['Return anatomy clipping values from anatMin and anatMax sliders.' char(10) ...
        'anataomyClip = viewGet(vw, ''Anatomy Clip'');'];
    DictViewHelp('anatslicedim') = ['Returns the dimension of the matrix that is associated with' char(10) ...
        'slices'];
    DictViewHelp('anatslicedims') = ['Returns the dimensions of each 2D array making up each slice'];
    DictViewHelp('anatsize') = ['Load an anatomy if one does not already exist'];
    DictViewHelp('anatomycurrentslice') = ['Return the anatomical underlay image for only one slice' char(10) ...
        'anat = viewGet(vw, ''Anatomy Current Slice'', curSlice);'];
    DictViewHelp('anatsizexyz') = ['The class data store the planes in a different order from the' char(10) ...
        'vw.anat.  If you want sizes that work for the class data, call' char(10) ...
        'this size.' char(10) ...
        'anatSizeXYZ = viewGet(vw, ''Anatomy Size For Class'');'];
    DictViewHelp('brightness') = ['Return the value of the brightness slider bar for the anatomical' char(10) ...
        'underlay image.' char(10) ...
        'brightness = viewGet(vw, ''brightness'');'];
    DictViewHelp('contrast') = ['Return the value of the contrast slider bar for the anatomical' char(10) ...
        'underlay image.' char(10) ...
        'contrast = viewGet(vw, ''contrast'');'];
    DictViewHelp('mmpervox') = ['Return the size of a voxel in mm' char(10) ...
        'mmPerVox = viewGet(vw, ''mm per voxel'');'];
    DictViewHelp('mmpervolvox') = ['Return the size of a gray/volume voxel in mm. ' char(10) ...
        'If we are in the gray or volume view, this is no different from' char(10) ...
        'viewGet(vw, ''mm per vox''). If we are in a different viewType' char(10) ...
        '(inplane, flat),  we need to initialize a hidden gray view' char(10) ...
        'and then read voxel size.' char(10) ...
        'mmpervolvox = viewGet(vw, ''mm per vol vox'');        '];
    DictViewHelp('gray') = '';
        DictViewHelp('gray') = '';
        DictViewHelp('ngraylayers') = ['Return the number of gray layers in the classification file.' char(10) ...
        'Assumes a Gray or Volume view.' char(10) ...
        'nGrayLayers = viewGet(vw, ''Number Gray Layers'');'];
        DictViewHelp('gray') = '';
        DictViewHelp('gray') = '';
        DictViewHelp('scannerxform') = ['Return the transform matrix from INPLANE coordinates (x,y,z, indices) to' char(10) ...
        'scanner coordinates (in mm). Inplane dicoms are needed to get' char(10) ...
        'this information.' char(10) ...
        'The transform will yield: scannerCoords = scannerXform*ipCoords;' char(10) ...
        'scannerxform = viewGet(vw, ''Scanner transform'');' char(10) ...
        'scannerxform = viewGet(vw, ''scannerXform'', [rawFile]);'];
        DictViewHelp('b0dir') = ['Return the direction of the B0 field from a scan as a unit vector' char(10) ...
        'b0vector = viewGet(vw, ''b0 direction'');'];
        DictViewHelp('b0angle') = ['Return the direction of b0 field from a scan as an angle in degrees' char(10) ...
        'b0angle = viewGet(vw, ''b0 angle'');'];
        DictViewHelp('rois') = ['Return ROIs as struct. Includes all ROIs and all fields' char(10) ...
        'ROIs = viewGet(vw, ''ROIs'');'];
        DictViewHelp('roistruct') = ['Return selected or specified ROI as struct. ' char(10) ...
        'ROI = viewGet(vw, ''ROI struct'');' char(10) ...
        'ROI = viewGet(vw, ''ROI struct'', 1);'];
        DictViewHelp('roicoords') = ['Return the coordinates of the currently selected or the specified' char(10) ...
        'ROI' char(10) ...
        'roiCoords = viewGet(vw, ''ROI coords'');' char(10) ...
        'ROI = 1; roiCoords = viewGet(vw, ''ROI coords'', ROI);'];
        DictViewHelp('roiindices') = ['Return the indices of all voxels in the currently selected or the' char(10) ...
        'specified ROI. Only implemented for gray / vol view. Could be' char(10) ...
        'implemented for other views. ' char(10) ...
        'roiIndices = viewGet(vw, ''ROI indices'');' char(10) ...
        'ROI = 1; roiIndices = viewGet(vw, ''ROI indices'', ROI);    '];
        DictViewHelp('gray') = '';
        DictViewHelp('gray') = '';
        DictViewHelp('roivertinds') = ['Return mesh indices for each voxel in a gray view ROI' char(10) ...
        'roiVertexIndices = ...' char(10) ...
        'viewGet(vw, ''ROI Vertex Indices'', [ROI],[mrmPrefs]);        '];
        DictViewHelp('roivertinds') = '';
        DictViewHelp('roivertinds') = '';
        DictViewHelp('roivertinds') = '';
        DictViewHelp('roivertinds') = '';
        DictViewHelp('roiname') = ['Return the name of the currently selected or the requested ROI.' char(10) ...
        'roiName = viewGet(vw, ''ROI name'');' char(10) ...
        'roi = 1; roiName = viewGet(vw, ''ROI name'', roi);'];
        DictViewHelp('roimodified') = ['Return the modification date of the currently selected or the' char(10) ...
        'requested ROI.' char(10) ...
        'roiName = viewGet(vw, ''ROI modified'');' char(10) ...
        'roi = 1; roiName = viewGet(vw, ''ROI modified'', roi);'];
        DictViewHelp('allroinames') = ['Return a cell array of the names of all currently loaded ROIs.' char(10) ...
        'roiNames = viewGet(vw, ''All ROI names'');'];
        DictViewHelp('nrois') = ['Return the number of currently loaded ROIs.' char(10) ...
        'nrois = viewGet(vw, ''n ROIs'');'];
        DictViewHelp('selectedroi') = ['Return the number of the currently selected ROI.' char(10) ...
        'selectedROI = viewGet(vw, ''Selected ROI'');'];
        DictViewHelp('filledperimeter') = ['Return the value of the field "filledPerimeter". Not sure exactly' char(10) ...
        'how this works, but we think this field is 1 if ROIs are drawn as' char(10) ...
        'filled perimeter and 0 if not, but perhaps it can take other' char(10) ...
        'values?' char(10) ...
        'filledPerimeter = viewGet(vw, ''filled perimeter'');'];
        DictViewHelp('selroicolor') = ['Return the color of the currently selected or the requested ROI.' char(10) ...
        'This can be a Matlab character for a color (''c'', ''w'', ''b'', etc)' char(10) ...
        'or an RGB triplet.' char(10) ...
        'selcol = viewGet(vw, ''Selected ROI color'');' char(10) ...
        'roi = 1; selcol = viewGet(vw, ''Selected ROI color'', roi);'];
        DictViewHelp('prevcoords') = ['Return the coords of the previous ROI state. ' char(10) ...
        'But what does this mean? How does it work?' char(10) ...
        'prevCoords = viewGet(vw, ''previous coords'');'];
        DictViewHelp('roistodisplay') = ['Return the number of each ROI that has been selected to be' char(10) ...
        'displayed. This can be one ROI only (the currently selected ROI),' char(10) ...
        'all ROIs, or a subset. A vector of index values is returned.' char(10) ...
        'See roiSetOptions for an explanation of this format.' char(10) ...
        'roisToDisplay = viewGet(vw, ''ROIs To Display'');'];
        DictViewHelp('roidrawmethod') = ['Return the method for drawing ROIs, such as ''perimeter'',' char(10) ...
        '''filledPerimeter''.' char(10) ...
        'ROIdrawMethod = viewGet(vw, ''ROI Draw Method'');'];
        DictViewHelp('showrois') = ['Return the boolean to indicate whether ROIs are drawn or hidden.' char(10) ...
        'Applies to views such as Volume, Gray, Inplane, Flat, and also' char(10) ...
        'meshes. ' char(10) ...
        '[OK, not quite a Boolean because I see that values can be -2, for' char(10) ...
        'example. What are all the possible values and what do they mean?] ' char(10) ...
        'showROIs = viewGet(vw, ''Show ROIs'');        '];
        DictViewHelp('hidevolumerois') = ['Return the Boolean ''hideVolumeROIs''. If true, then ROIs in' char(10) ...
        'Gray/Volume view are not drawn (but ROIs on meshes may still be' char(10) ...
        'drawn.) The reason we might want to do this is because redrawing' char(10) ...
        'ROIs in the Volume view can be very slow. This field works' char(10) ...
        'indepently from the field ''showROIs'', which controls whether ROIs' char(10) ...
        'are displayed in any view and on meshes. So if showROIs is true' char(10) ...
        'and hideVolumeROIs is false, ROIs will show on a mesh, an inplane' char(10) ...
        'view, or a flat view, but not a Gray/Volume view. If showROIs is' char(10) ...
        'false, no ROIs will be shown anywhere.' char(10) ...
        'hidevolumerois = viewGet(vw, ''Hide Volume ROIs'');'];
        DictViewHelp('maskrois') = ['Return the Boolean ''maskROIs''. If maskROIs is true, then maps' char(10) ...
        'that are displayed on meshes are masked out everywhere outside of' char(10) ...
        'the currently displayed ROIs. The currently displayed ROIs might' char(10) ...
        'be just the currently selected ROI, all the ROIs, or a subset of' char(10) ...
        'ROIs. (See the case ''roisToDisplay''.)' char(10) ...
        'maskROIs = viewGet(vw, ''mask ROIs'');'];
        DictViewHelp('tseriesdir') = ['Return tSeries directory for a view; make it if it does not' char(10) ...
        'exist.' char(10) ...
        'makeIt = 0; tDir = viewGet(vw,''tSeriesDir'',makeIt);' char(10) ...
        'makeIt = 1; tDir = viewGet(vw,''tSeriesDir'',makeIt);' char(10) ...
        'tDir = viewGet(vw,''tSeriesDir'')'];
        DictViewHelp('datasize') = ['Return the size of the data arrays, i.e., size of co for' char(10) ...
        'a single scan.' char(10) ...
        'dataSize = viewGet(vw, ''Data Size'');' char(10) ...
        'scan = 1; dataSize = viewGet(vw, ''Data Size'', scan);'];
        DictViewHelp('dim') = ['Return the dimension of data in current slice or specificed slice' char(10) ...
        'dim = viewGet(vw, ''Slice Dimension'')' char(10) ...
        'scan = 1; dim = viewGet(vw, ''Slice Dimension'', scan)        '];
        DictViewHelp('functionalslicedim') = ['Return the dimension of functional data in current slice or' char(10) ...
        'specificed slice' char(10) ...
        'dim = viewGet(vw, ''Slice Dimension'')' char(10) ...
        'scan = 1; dim = viewGet(vw, ''Slice Dimension'', scan)'];
        DictViewHelp('tseries') = ['Return the time series of all data currently loaded into the view' char(10) ...
        'struct.' char(10) ...
        'tseries = viewGet(vw, ''time series'');'];
        DictViewHelp('tseriesslice') = ['Return the time series for the currently selected slice if it is' char(10) ...
        'loaded into the view struct (return blank otherwise).' char(10) ...
        'tseries = viewGet(vw, ''Time Series Slice'');'];
        DictViewHelp('tseriesscan') = ['Return the time series for the current scan (if it is loaded into' char(10) ...
        'the view struct; return blank if it is not loaded).' char(10) ...
        'tseriesScan = viewGet(vw, ''time series scan'');'];
        DictViewHelp('tr') = ['Return the scan TR in seconds' char(10) ...
        'tr = viewGet(vw,''tr'')' char(10) ...
        'scan = 1; tr = viewGet(vw,''tr'',scan)'];
        DictViewHelp('nframes') = ['Return the number of time frames in the current or specified' char(10) ...
        'scan.' char(10) ...
        'nframes = viewGet(vw,''nFrames'');' char(10) ...
        'scan = 1; nframes = viewGet(vw,''nFrames'',scan);'];
        DictViewHelp('ncycles') = ['Return the number of cycles in the current or specified scan' char(10) ...
        '(assuming scan is set up for coranal). ' char(10) ...
        'nycles = viewGet(vw,''ncycles'')' char(10) ...
        'scan = 1; nycles = viewGet(vw,''ncycles'', scan)'];
        DictViewHelp('framestouse') = ['Return a vector of time frames in the current or specified' char(10) ...
        'scan to be used for coranal (block) analyses' char(10) ...
        'frames = viewGet(vw,''frames to use'');' char(10) ...
        'scan = 1; frames = viewGet(vw,''frames to use'',scan);'];
        DictViewHelp('rmfile') = ['Return the path to the currently loaded retinotopy model.' char(10) ...
        'rmFile = viewGet(vw, ''retinotopy model file'');'];
        DictViewHelp('rmmodel') = ['Return the currently loaded retinotopy model struct.' char(10) ...
        'rm = viewGet(vw, ''retinotopy model'');'];
        DictViewHelp('rmcurrent') = ['Return the currently selected retinotopy model struct. Note that' char(10) ...
        'there may be multiple models loaded.' char(10) ...
        'rm = viewGet(vw, ''rm current model'');'];
        DictViewHelp('rmmodelnames') = ['Return the description of currently loaded retinotopy models.' char(10) ...
        'models = viewGet(vw, ''rm model names'');' char(10) ...
        'models = viewGet(vw, ''retinotopy model names'');'];
        DictViewHelp('rmparams') = ['Return the retinotopy model parameters.' char(10) ...
        'params = viewGet(vw, ''Retinotopy Parameters'');'];
        DictViewHelp('rmstimparams') = ['Return the retinotopy model stimulus parameters. This is a subset' char(10) ...
        'of the retinopy model parameters.' char(10) ...
        'stimParams = viewGet(vw, ''RM Stimulus Parameters'');'];
        DictViewHelp('rmmodelnum') = ['Return the retinotopy model number that is currently selected.' char(10) ...
        '(There may be more than one model loaded.)' char(10) ...
        'modelNum = viewGet(vw, ''Retinotopy Model Number'');'];
        DictViewHelp('rmhrf') = ['Return the hrf struct for the current retinopy model. This struct' char(10) ...
        'contains a descriptor (such as ''two gammas (SPM style)'') and the' char(10) ...
        'parameters associated with this function.' char(10) ...
        'rmhrf = viewGet(vw, ''Retinotopy model HRF'');'];
        DictViewHelp('one gamma (boynton style)') = '';
        DictViewHelp('two gammas (spm style)') = '';
        DictViewHelp('impulse') = '';
        DictViewHelp('impulse') = '';
        DictViewHelp('allmeshes') = ['Return the structs for all currently loaded meshes.' char(10) ...
        'allmeshes = viewGet(vw, ''all meshes'');'];
        DictViewHelp('allmeshids') = ['Return the ID list for all meshes. IDs are numbers generated by' char(10) ...
        'mrMesh that are associated with each new mesh session. They are' char(10) ...
        'typically 4 digit numbers starting at 1001. (why??)' char(10) ...
        'idList = viewGet(vw,''All Window IDs'');'];
        DictViewHelp('mesh') = ['Return the mesh structure for the selected or the requested mesh.' char(10) ...
        'If the mesh number is specificied, it indexes the cell array of' char(10) ...
        'meshes currently attached to the view structure. The mesh number' char(10) ...
        'bears no relation to the mesh ID number, which is generated by' char(10) ...
        'the mesh server.' char(10) ...
        'msh = viewGet(vw, ''mesh'');' char(10) ...
        'meshnum = 1; msh = viewGet(vw, ''mesh'', meshnum);'];
        DictViewHelp('currentmesh') = ['Return the mesh structure for the selected mesh. This is' char(10) ...
        'redundant with the case ''mesh''.' char(10) ...
        'msh = viewGet(vw, ''Current Mesh'');'];
        DictViewHelp('meshn') = ['Return the number of the currently selected mesh (index into the' char(10) ...
        'cell array of meshes)' char(10) ...
        'msh = viewGet(vw, ''current mesh number'');'];
        DictViewHelp('meshdata') = ['I think this is supposed to return the data displayed on the' char(10) ...
        'current mesh, but I have just tried it and it doesn''t seem to' char(10) ...
        'work. So what does it do?' char(10) ...
        'meshData = viewGet(vw, ''current mesh data'');'];
        DictViewHelp('nmesh') = ['Return the number of meshes currently attached to the view' char(10) ...
        'struct.' char(10) ...
        'nmesh = viewGet(vw, ''Number of Meshes'');'];
        DictViewHelp('meshnames') = ['Return the name of all meshes currently attached to the view' char(10) ...
        'struct.' char(10) ...
        'meshNames = viewGet(vw, ''mesh names'');'];
        DictViewHelp('meshdir') = ['Return the directory in which the currently selected mesh' char(10) ...
        'resides. Default to anat dir if not found.' char(10) ...
        'meshDir = viewGet(vw, ''mesh directory'');        '];
        DictViewHelp('nodes') = ['Return the array of nodes. Only gray views have nodes. See help' char(10) ...
        'for mrManDist.m for a description of the node structure. In' char(10) ...
        'brief, nodes are 8 x nvoxels. The first 3 rows correspond to the' char(10) ...
        'voxel location and the next 5 correspond to gray graph-related' char(10) ...
        'data.' char(10) ...
        'nodes = viewGet(vw, ''nodes'');'];
        DictViewHelp('xyznodes') = ['Return the xyz coordinates of the gray voxels as found in nodes' char(10) ...
        'array. Assumes a Gray view. See case ''nodes'' and help for' char(10) ...
        'mrManDist for more information.' char(10) ...
        '' char(10) ...
        'Must call this sagittal, axial coronal or whatever the mapping is' char(10) ...
        'ras, 06/07 -- I believe it''s [cor axi sag]. coords is [axi cor sag].' char(10) ...
        '' char(10) ...
        'xyzNodes = viewGet(vw, ''xyz nodes'');'];
        DictViewHelp('nodegraylevel') = ['Return the gray level of each voxel as determined by the nodes' char(10) ...
        'array. Assumes a Gray view. See case ''nodes'' and help for' char(10) ...
        'mrManDist for more information.' char(10) ...
        'nodeGrayLevel = viewGet(vw, ''gray level'');'];
        DictViewHelp('nnodes') = ['Return the number of nodes. Assumes a Gray view. See case ''nodes''' char(10) ...
        'and help for mrManDist for more information. ' char(10) ...
        'nNodes = viewGet(vw, ''number of nodes'');'];
        DictViewHelp('edges') = ['Return the edge structure of the gray graph. Assumes a Gray view.' char(10) ...
        'See help for mrManDist for more information. ' char(10) ...
        'edges = viewGet(vw, ''edges'');'];
        DictViewHelp('nedges') = ['Return the number of edges in the gray graph. Assumes a Gray' char(10) ...
        'view. See case ''edges'' and help for mrManDist for more' char(10) ...
        'information.' char(10) ...
        'nEdges = viewGet(vw, ''number of edges'');      '];
        DictViewHelp('allleftnodes') = ['Return the subset of nodes in the Gray graph that are in the left' char(10) ...
        'hemisphere. See mrgGrowGray and mrManDist.' char(10) ...
        'allLeftNodes = viewGet(vw, ''all left nodes'');'];
        DictViewHelp('allleftedges') = ['Return the subset of edges in the Gray graph that are in the left' char(10) ...
        'hemisphere. See mrgGrowGray and mrManDist.' char(10) ...
        'allLeftEdges = viewGet(vw, ''all left edges'');'];
        DictViewHelp('allrightnodes') = ['Return the subset of nodes in the Gray graph that are in the' char(10) ...
        'right hemisphere. See mrgGrowGray and mrManDist.' char(10) ...
        'allRightNodes = viewGet(vw, ''all right nodes'');'];
        DictViewHelp('allrightedges') = ['Return the subset of edges in the Gray graph that are in the' char(10) ...
        'right hemisphere. See mrgGrowGray and mrManDist.' char(10) ...
        'allRightEdges = viewGet(vw, ''all right edges'');'];
        DictViewHelp('allnodes') = ['Return all nodes from Gray graph by taking union of allLeftNodes' char(10) ...
        'and allRightNodes. ' char(10) ...
        '' char(10) ...
        'This is NOT necessarily the same as simply returning ''vw.nodes''.' char(10) ...
        'When we install a segmentation, we can either keep all the nodes' char(10) ...
        'in the gray graph, or only those that fall within the functional' char(10) ...
        'field of view (to save space). When we do the latter, the fields' char(10) ...
        'vw.coords, vw.nodes, and vw.edges contain only the coords, nodes,' char(10) ...
        'and eges within the functional field of view. However the fields' char(10) ...
        'vw.allLeftNodes, vw.allLeftEdges, vw.allRightNodes, and' char(10) ...
        'vw.allRightEdges contain the edges and nodes for the entire' char(10) ...
        'hemisphere' char(10) ...
        '' char(10) ...
        'Example: nodes = viewGet(vw, ''all nodes'');'];
        DictViewHelp('alledges') = ['Return all edges from Gray graph by taking union of allLeftEdges' char(10) ...
        'and allRightEdges. See ''allnodes'' for explanation.' char(10) ...
        '' char(10) ...
        'Example: edges = viewGet(vw, ''all edges'');'];
        DictViewHelp('coords') = ['Return all the coordinates in the current view. If in Flat view,' char(10) ...
        'return the coordinates for a particular slice (slice specified in' char(10) ...
        'varargin{1}). If in Inplane view, slice specification is' char(10) ...
        'optional. If in Gray or Volume view, slice specification is' char(10) ...
        'ignored.' char(10) ...
        '<gray, volume or inplane> ' char(10) ...
        'coords = viewGet(vw, ''coords'');' char(10) ...
        '<flat or inplane>' char(10) ...
        'slice  = viewGet(vw, ''current slice''); ' char(10) ...
        'coords = viewGet(vw,''coords'', slice);'];
        DictViewHelp('allcoords') = ['Return all coords from Gray graph, including those that are not' char(10) ...
        'included in the functional field of view. See ''allnodes'' for' char(10) ...
        'explanation. If session was initialized with the option ' char(10) ...
        '''keepAllNodes'' == true, then this call will be identical to' char(10) ...
        'viewGet(vw.coords).' char(10) ...
        '' char(10) ...
        'Example: coords = viewGet(vw, ''all coords'');'];
        DictViewHelp('coordsfilename') = ['Return the path to the file in which coordinates are stored.' char(10) ...
        'Assumes that a gray view has been created (though current view' char(10) ...
        'can be any type).' char(10) ...
        'coordsFileName = viewGet(vw, ''coords file name'');'];
        DictViewHelp('ncoords') = ['Return the number of coordinates in the current view. See case' char(10) ...
        '''coords''.' char(10) ...
        'nCoords = viewGet(vw, ''number of coords'');'];
        DictViewHelp('classfilename') = ['Return the path to either the left or the right gray/white' char(10) ...
        'classification file. ' char(10) ...
        'fname = viewGet(vw, ''class file name'', ''left'');' char(10) ...
        'fname = viewGet(vw, ''class file name'', ''right'');'];
        DictViewHelp('classdata') = ['classFileRight = viewGet(vw,''class data'',''right'');'];
        DictViewHelp('graymatterfilename') = ['grayFile = viewGet(vw,''Gray matter filename'',''right'');'];
        DictViewHelp('datavalindex') = '';
        DictViewHelp('analysisdomain') = '';
        DictViewHelp('graycoords') = ['''graycoords'' is also an alias for coords in volume/gray views:'];
        DictViewHelp('leftpath') = '';
        DictViewHelp('rightpath') = '';
        DictViewHelp('fliplr') = '';
        DictViewHelp('imagerotation') = '';
        DictViewHelp('hemifromcoords') = '';
        DictViewHelp('roihemi') = '';
        DictViewHelp('ishidden') = '';
        DictViewHelp('ui') = '';
        DictViewHelp('fignum') = '';
        DictViewHelp('windowhandle') = '';
        DictViewHelp('displaymode') = '';
        DictViewHelp('anatomymode') = '';
        DictViewHelp('coherencemode') = '';
        DictViewHelp('correlationmode') = '';
        DictViewHelp('phasemode') = '';
        DictViewHelp('amplitudemode') = '';
        DictViewHelp('projectedamplitudemode') = '';
        DictViewHelp('mapmode') = '';
        DictViewHelp('zoom') = '';
        DictViewHelp('crosshairs') = '';
        DictViewHelp('locs') = '';
        DictViewHelp('phasecma') = ['This returns only the color part of the map'];
        DictViewHelp('cmapcurrent') = '';
        DictViewHelp('cmapcurmodeclip') = '';
        DictViewHelp('cmapcurnumgrays') = '';
        DictViewHelp('cmapcurnumcolors') = '';
        DictViewHelp('flipud') = ['Return the boolean indicating whether to invert the image u/d in' char(10) ...
        'the graphical user interface.  It is sometimes convenient to do' char(10) ...
        'this in the Inplane view if the top of the slice corresponds to' char(10) ...
        'the bottom of the brain.' char(10) ...
        'Example: ' char(10) ...
        'flipud = viewGet(vw, ''flip updown'');'];
        DictViewHelp('ampclip') = '';
        DictViewHelp('addmesh') = '';
        DictViewHelp('anatinitialize') = '';
        DictViewHelp('cbarrange') = '';
        DictViewHelp('colorbarhandle') = '';
        DictViewHelp('deletemesh') = '';
        DictViewHelp('initdisplaymodes') = '';
        DictViewHelp('leftclassfile') = '';
        DictViewHelp('leftgrayfile') = '';
        DictViewHelp('mainaxishandle') = '';
        DictViewHelp('refreshfn') = '';
        DictViewHelp('rightclassfile') = '';
        DictViewHelp('rightgrayfile') = '';
        DictViewHelp('roi') = '';
        DictViewHelp('roioptions') = '';
        DictViewHelp('spatialgrid') = '';
        DictViewHelp('spatialgrad') = '';
        DictViewHelp('uiimage') = '';
        DictViewHelp('size') = '';

end %if

if DictViewHelp.isKey(paramIn)
    res = DictViewHelp(paramIn);
else
    error('Dict:ViewHelpError', 'The input %s does not appear to be in the dictionary', paramIn);
end %if

return


function initialize
% add paths for Thomas' subdirectories
addpath('~/zmap/src/thomas:', ...
     '~/zmap/src/thomas/synthetic:', ...
     '~/zmap/src/thomas/decluster:', ...
     '~/zmap/src/thomas/decluster/gardnerknopoff:', ...
     '~/zmap/src/thomas/decluster/marsan:', ...
     '~/zmap/src/thomas/decluster/reasen:', ...
     '~/zmap/src/thomas/etas:', ...
     '~/zmap/src/thomas/gui:', ...
     '~/zmap/src/thomas/plot:', ...
     '~/zmap/src/thomas/pov:', ...
     '~/zmap/src/thomas/seismicrates:', ...
     '~/zmap/src/thomas/seismicrates/ex:', ...
     '~/zmap/src/thomas/synthetic:', ...
     '~/zmap/src/thomas/ex:', ...
     '~/zmap/results:', ...
     '~/zmap/eq_data:', ...
     '~/zmap/eq_data/Alaska:', ...
     '~/zmap/eq_data/Adak:', ...
     '~/zmap/eq_data/SCEC:', ...
     '~/zmap/eq_data/Shearer:', ...
     '~/zmap/eq_data/Taiwan:')


%% Export Pole Figure Data
%
%%
%