function vbm_ui(varargin)
% vbm_ui.m - interface for performing vbm preprocessing tasks.
% Jan 10 2005. 
% SEE ALSO: make_template.m, update_template.m, vbm_mni.m, vbm_custom.m,
% vbm5.m, vbm_recover_ui.m, mls_cleanup.m
% Jan. 10, 2006
% SEE ALSO: vbm_ui.m
% Jan. 10, 2006
% Matthew L. Senjem
% Mayo Clinic 
% Senjem.Matthew1@mayo.edu
%
% When using this code, please reference the following paper:
%
% Senjem ML, Gunter JL, Shiung MM, Petersen RC, Jack CR Jr., "Comparison of different methodological implementations of voxel-based
% morphometry in neurodegenerative disease." Neuroimage. 2005 Jun;26(2):600-8. 

spm_defaults
global defaults
if nargin & strcmpi(varargin{1},'sge')
    sge_vbm_ui(varargin{1});
else
    estimate = spm_input('What to do?','+1','m','Create template and priors|Update template and priors|Run VBM with MNI template|VBM with Custom template|Create Template AND use it to run VBM|Recover crashed session|Delete old images',[1 2 3 4 5 6 7], 4);

    switch estimate
        case 1
            make_template;
        case 2
            update_template('');
        case 3
            vbm_mni;
        case 4
            vbm_custom;
        case 5
            vbm5;
        case 6
            vbm_recover_ui;
        case 7
            mls_cleanup;
        otherwise
            error('unknown input')
    end
end