 function [] = pcafaces_wrapper()
% PCAFACES_WRAPPER: Calls PCAFACE with (pre)set arguments
%
%    Licensing
%
%      GNU GPL version 3
%
%    GENERAL
%
%      Script that assembled arguments for experiments, calling functions to do the heavy lifting with more clutter and daunting code
%
%    INPUT/S
%
%      -None
%
%    OUTPUT/S
%
%      -None
%
%    PENDING WORK
%
%      -Deprecated because of the GUI, but can be updated for CLI operation (just add missing arguments)
%
%    KNOWN BUG/S
%
%      -
%
%    COMMENT/S
%
%      Keep all program options in this file, not in other files
%
%    RELATED FUNCTION/S
%
%      PCAFACE
%
%    ABOUT
%
%      -Created:     February 27th, 2011
%      -Last update: February 2011
%      -Revision:    0.0.1
%      -Author:      Dr. R. S. Schestowitz
% ==============================================================

% =================================
% Experimental options

% prepare the parameters for input

directory=''; % directory for images to be be found in (if empty, reply on the option below as it's possible to use a mixed sample or NIST/FRGC-2.0 dataset
load_FRGC=0; % load NIST/FRGC-2.0 dataset (otherwise use a sample or use path with files)

% pre-processing

remove_bg_outliers=1; % post-process the image by removing bad data like holes and spikes
frame_size=10; % when seeking holes, consider neighbourhood frame of this size (dimensions of frame are 2L+1 by 2L+1, where L is frame_size)
round_up_values=0; % change original values to be whole numbers (like integers)
apply_smoothing=0; % vertical and horizontal smoothing applied to original data (requires MATLAB toolbox for image analysis)

% display and debugging

plot_xy_diffs=0; % whether to debug check of distance in X and Y axes
show_data_as_surfaces=0; % display the data as a surface
show_data_as_mesh=0; % display as a mesh
show_data_as_images=0; % display as an image
show_cloud_as_raw_mesh=0; % experimental option
show_histogram=0; % whether or not a figure should be displayed which shows the distribution of depths (z)
skip_size=1; % separation between sample points for meshes and surfaces (for speed and clarify)
show_data_again_after_normalisation=1; % post-processing visualisation (usually off, except for debugging purposes)
surface_lighting=0; % determines whether or not Phong-type method will be used to render light on the surface
show_xy_images=0; % whether to display the images which show how X and Y are laid out

% cropping method for face range

cropping_method='circle'; % 'rectangle', other methods, or otherwise assumed to be circle
nose_range=66; % how big a range away from the tip of the nose to include (measured in pixels or relative, depending on cropping method used)

% cropping metrics for rigid areas to be selected

cutoff_x_top=15; % parameters for cropping rigid areas, starting with relative distance from bottom of eye to nose tip
cutoff_x_bottom=12; % boundary underneath the nose
cutoff_y_right=30; % distance from centre of nose to ends (sides) of the nose
cutoff_y_left=30; % usually the same as above

% registration and modeling

use_icp2=0; % if 0, then ICPv1 will be used
perform_pca=1; % go through (or skip) the PCA phase
select_subregion=[200,300,200,300]; % x0, x, y0, and y for selecting face region (if 0, then choose entire data range, which becomes a RAM hog when PCA is reached) 

% =================================
% Alternative options (mostly redundant)

%  directory='';
%  load_FRGC=0; % load NIST/FRGC-2.0 dataset (otherwise use a sample)
%  remove_bg_outliers=1; % post-process the image by removing bad data like holes and spikes
%  round_up_values=0; % change original values to be whole numbers (like integers)
%  show_data_as_surfaces=0; % display the data as a surface
%  show_data_as_mesh=1; % display as a mesh
%  show_data_as_images=1; % display as an image 
%  apply_smoothing=1; % vertical and horizontal smoothing applied to original data
%  show_cloud_as_raw_mesh=0; % experimental option
%  show_histogram=0; % whether or not a figure should be displayed which shows the distribution of depths (z)
%  skip_size=1; % separation between sample points for meshes and surfaces (for speed and clarify)
%  frame_size=50; % when seeking holes, consider neighbourhood frame of this size (dimensions of frame are 2L+1 by 2L+1, where L is frame_size)
%  cropping_method='circle';
%  
%  directory='';
%  load_FRGC=0; % load NIST/FRGC-2.0 dataset (otherwise use a sample)
%  remove_bg_outliers=1; % post-process the image by removing bad data like holes and spikes
%  round_up_values=0; % change original values to be whole numbers (like integers)
%  show_data_as_surfaces=0; % display the data as a surface
%  show_data_as_mesh=0; % display as a mesh
%  show_data_as_images=1; % display as an image 
%  apply_smoothing=1; % vertical and horizontal smoothing applied to original data
%  show_cloud_as_raw_mesh=0; % experimental option
%  show_histogram=0; % whether or not a figure should be displayed which shows the distribution of depths (z)
%  skip_size=1; % separation between sample points for meshes and surfaces (for speed and clarify)
%  frame_size=50; % when seeking holes, consider neighbourhood frame of this size (dimensions of frame are 2L+1 by 2L+1, where L is frame_size)
%  cropping_method='circle';


% =================================
% Wrapper's body

pcapath; % add paths just in case these are missing

% now prepare the images for statistical analysis; various steps are included in pcafaces

[output] = pcafaces(directory, load_FRGC, remove_bg_outliers, round_up_values, show_data_as_surfaces, show_data_as_mesh, show_data_as_images, apply_smoothing, show_cloud_as_raw_mesh, show_histogram, skip_size, frame_size, cropping_method, nose_range, show_data_again_after_normalisation, surface_lighting, show_xy_images, cutoff_x_top, cutoff_x_bottom, cutoff_y_right, cutoff_y_left, plot_xy_diffs, use_icp2, select_subregion, perform_pca);