function varargout = register(varargin)
% REGISTER: callback functions for GMDSPCA GUI
% REGISTER is an M-file for register.fig
%      REGISTER, by itself, creates a new REGISTER or raises the existing
%      singleton*.
%
%      H = REGISTER returns the handle to a new REGISTER or the handle to
%      the existing singleton*.
%
%      REGISTER('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in REGISTER.M with the given input arguments.
%
%      REGISTER('Property','Value',...) creates a new REGISTER or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before register_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to register_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% Code construction assisted by GUIDE
%
%    GENERAL
%
%      varargout = register(varargin)
%
%    INPUT/S
%
%      -Currently not applicable
%          
%           
%    OUTPUT/S
%
%      -Not used at present
%
%    PENDING WORK
%
%      -The function will be extended to have more callbacks. Shifting of
%      certain sub-routines outside might be possible in the future,
%      provided that objects in the GUI need not be passed.
%
%    KNOWN BUG/S
%
%      -February: Some callbacks such as MDL are not yet implemnented and a
%      sensible message box appears.
%
%    COMMENT/S
%
%      -
%
%    RELATED FUNCTION/S
%
%      
%
%    ABOUT
%
%      -Created:     2011
%      -Last update: 
%      -Revision:    0.1.0
%      -Author:      Dr. R. S. Schestowitz
% ==============================================================

% Edit the above text to modify the response to help_button register

% Begin initialization code - DO NOT EDIT

gui_Singleton = 0;
gui_State = struct('gui_Name',       mfilename, ...
    'gui_Singleton',  gui_Singleton, ...
    'gui_OpeningFcn', @register_OpeningFcn, ...
    'gui_OutputFcn',  @register_OutputFcn, ...
    'gui_LayoutFcn',  [] , ...
    'gui_Callback',   []);
if nargin & isstr(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% ==================================================================== %  

% --- Executes just before register is made visible.
function register_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to register (see VARARGIN)

% Choose default command line output for register
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

if strcmp(get(hObject,'Visible'),'off')
    initialize_gui(hObject, handles);
end


  set(handles.resume, 'cdata', playbutton);
  set(handles.pause, 'cdata', stopbutton);
  set(handles.register_1d, 'cdata', registerbutton);
  set(handles.help_button, 'cdata', helpbutton);
  set(handles.abort, 'cdata', abortbutton);
  set(handles.reset, 'cdata', resetbutton);
  
% ==================================================================== %  

% --- Outputs from this function are returned to the command line.
function varargout = register_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;

% ==================================================================== %  

function register = registerbutton

register = iconize(imread('reg.jpg'));
register(register>240) = .69*255;

% ==================================================================== %  

function stop = stopbutton

stop = iconize(imread('stop.jpg'));
stop(stop>240) = .69*255;

% ==================================================================== %   

function play = playbutton

play = iconize(imread('play.jpg'));
play(play>240) = .69*255;

% ==================================================================== %   

function abort = abortbutton

abort = iconize(imread('abort.jpg'));
abort(abort>240) = .69*255;

% ==================================================================== %   

function reset = resetbutton

reset = iconize(imread('reset.jpg'));
reset(reset>240) = .69*255;

% ==================================================================== %   
 
function help = helpbutton

help = iconize(imread('help.jpg'));
help(help>240) = .69*255;

% ==================================================================== %  

% --- Hand-written callback 
% --- Used to create icon data from an image

function out = iconize(a)

% Find the size of the acquired image and determine how much data will need
% to be lost in order to form a 18x18 icon
[r,c,d] = size(a);
r_skip = ceil(r/25);
c_skip = ceil(c/25);

% Create the 25x25 icon (RGB data)
out = a(1:r_skip:end,1:c_skip:end,:);

% ==================================================================== %     

function register_1d_Callback(hObject, eventdata, handles)

% getappdata(0, 'exit_handle') This is how advanced menu values are
% obtained


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is where registration actually starts




  set(handles.status_bar, 'String', 'Registration in progress...');
  % indicate status in the status bar
  
  set(handles.pause, 'Enable', 'on');
  set(handles.resume, 'Enable', 'off');
  % enable the buttons that control tehe state of the process (will
  % currently work only if drawing is involved
  
  % now prepare the images for statistical analysis; various steps are included in pcafaces

  % filenames:

  if (str2num(getappdata(0, 'open_expressions')))



% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_11.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_12.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_13.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_14.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_15.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_16.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_17.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_18.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_19.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_20.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_21.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_22.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_23.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_24.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_25.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_26.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_27.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_28.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_29.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_30.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_31.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_32.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_33.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_34.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_35.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_36.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_37.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_38.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_39.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_4.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_40.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_5.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_7.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_8.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_1_Video/GIPFaces_1_9.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_100.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_102.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_104.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_105.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_106.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_107.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_108.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_109.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_11.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_110.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_111.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_112.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_113.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_115.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_116.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_117.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_118.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_119.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_12.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_120.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_121.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_122.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_123.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_124.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_125.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_126.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_127.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_128.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_13.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_14.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_15.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_16.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_17.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_18.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_19.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_20.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_21.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_23.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_24.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_26.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_27.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_28.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_29.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_30.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_31.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_32.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_33.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_34.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_36.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_37.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_38.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_39.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_4.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_41.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_42.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_43.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_44.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_45.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_46.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_47.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_48.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_49.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_5.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_50.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_51.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_52.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_53.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_54.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_55.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_56.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_57.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_59.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_6.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_60.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_61.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_63.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_64.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_65.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_66.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_67.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_68.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_69.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_7.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_70.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_71.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_72.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_73.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_74.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_75.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_76.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_77.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_78.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_79.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_80.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_81.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_82.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_83.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_84.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_85.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_86.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_87.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_88.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_89.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_9.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_90.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_91.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_92.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_93.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_94.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_95.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_96.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_97.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_98.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_2_Video/GIPFaces_2_99.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_10.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_5.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_6.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_7.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_8.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_3_Expression/GIPFaces_3_9.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB_G.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB_L.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB_N.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexB_S.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/alexp_A.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_10.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_11.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_12.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_13.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_14.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_15.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_16.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_17.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_18.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_19.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_20.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_21.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_22.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_23.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_24.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_25.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_26.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_27.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_28.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_29.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_30.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_31.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_32.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_33.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_34.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_35.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_36.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_37.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_38.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_39.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_4.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_40.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_41.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_42.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_43.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_44.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_45.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_46.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_47.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_48.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_49.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_5.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_50.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_51.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_52.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_53.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_54.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_55.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_56.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_57.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_58.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_59.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_6.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_60.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_61.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_62.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_63.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_64.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_65.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_66.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_67.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_68.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_69.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_7.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_70.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_71.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_72.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_73.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_74.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_75.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_76.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_77.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_78.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_79.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_8.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_80.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/GIPFaces_5_9.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/tigran1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/tigran2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/tigran3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir_G.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir_L.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir_N.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/vladimir_S.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron3.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_A.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_G.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_HS.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_L.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_N.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yaron_S.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_A1.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_A2.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_G.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_HS.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_L.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_N.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_5_Video/yohai_S.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0250/GIPFaces_7_0250_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0251/GIPFaces_7_0251_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0252/GIPFaces_7_0252_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0253/GIPFaces_7_0253_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0254/GIPFaces_7_0254_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0255/GIPFaces_7_0255_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0256/GIPFaces_7_0256_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0257/GIPFaces_7_0257_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0258/GIPFaces_7_0258_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0259/GIPFaces_7_0259_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0260/GIPFaces_7_0260_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0261/GIPFaces_7_0261_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_front_smilr.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0262/GIPFaces_7_0262_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0263/GIPFaces_7_0263_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0264/GIPFaces_7_0264_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0265/GIPFaces_7_0265__.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0266/GIPFaces_7_0266_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0267/GIPFaces_7_0267_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0268/GIPFaces_7_0268_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0269/GIPFaces_7_0269_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0270/GIPFaces_7_0270_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0271/GIPFaces_7_0271_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0272/0272_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0273/GIPFaces_7_0273_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0274/GIPFaces_7_0274_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0275/GIPFaces_7_0275_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0276/GIPFaces_7_0276_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0276/GIPFaces_7_0276_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0277/GIPFaces_7_0277_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0278/GIPFaces_7_0278_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0279/GIPFaces_7_0279_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0280/GIPFaces_7_0280_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_45_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_45_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_90_l.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_90_r.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_front.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_front_smile.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0281/GIPFaces_7_0281_front_up.v3r';
% expressions_fileName = '/mnt/gip-main/data/3D Data/GIP_3D_Faces/GIPFaces_7_Angles/GIPFaces_7_0282/GIPFaces_7_0282_45_l.v3r';






    % expressions_fileName = '~/Facial-Expressions-Recognition/Anger.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Joy.v3f';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Joy.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Sad.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Shira1.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Shira2.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Smile.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/Suprise.v3r';
    % expressions_fileName = '~/Facial-Expressions-Recognition/fear.v3r';

    setappdata(0, 'expressions_fileName', '~/Facial-Expressions-Recognition/Anger.v3r'); % file to open hard-coded into the program
    setappdata(0, 'neutrals_fileName', '~/Facial-Expressions-Recognition/Shira1.v3r'); % the larger set among the two


    if (str2num(getappdata(0, 'matching_mode')))

      range_minimum=str2num(getappdata(0, 'matching_iterator'));
      range_step=1;
      range_maximum=load_expressions(getappdata(0, 'expressions_fileName'));

      for i = range_minimum:range_step:range_maximum,
	run_program();
	setappdata(0, 'matching_mode', num2str((str2num(getappdata(0, 'matching_iterator'))+1)));
      end

    else
      [output]=run_program();
      setappdata(0, 'output',output),
    end
  else
    run_program();
  end

  set(handles.pause, 'Enable', 'off');
  set(handles.resume, 'Enable', 'off');
  % disable these buttons as they are not applicable when the application
  % does not run
  set(handles.status_bar, 'String', getappdata(0, 'output'));
  % get status returned from the function at the end of exectution and
  % display it in the status bar



%% Registration ends
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% ==================================================================== % 


function [output]=run_program()

[output] = pcafaces(getappdata(0, 'directory'), ... 
str2num(getappdata(0, 'load_FRGC')), ... 
str2num(getappdata(0, 'remove_bg_outliers')), ... 
str2num(getappdata(0, 'round_up_values')), ... 
str2num(getappdata(0, 'show_data_as_surfaces')), ... 
str2num(getappdata(0, 'show_data_as_mesh')), ... 
str2num(getappdata(0, 'show_data_as_images')), ... 
str2num(getappdata(0, 'apply_smoothing')), ... 
str2num(getappdata(0, 'show_cloud_as_raw_mesh')), ... 
str2num(getappdata(0, 'show_histogram')), ... 
str2num(getappdata(0, 'skip_size')), ... 
str2num(getappdata(0, 'frame_size')), ... 
getappdata(0, 'cropping_method'), ... 
str2num(getappdata(0, 'nose_range')), ... 
str2num(getappdata(0, 'show_data_again_after_normalisation')), ... 
str2num(getappdata(0, 'surface_lighting')), ... 
str2num(getappdata(0, 'show_xy_images')), ... 
str2num(getappdata(0, 'cutoff_x_top')), ... 
str2num(getappdata(0, 'cutoff_x_bottom')), ... 
str2num(getappdata(0, 'cutoff_y_right')), ... 
str2num(getappdata(0, 'cutoff_y_left')), ... 
str2num(getappdata(0, 'plot_xy_diffs')), ... 
str2num(getappdata(0, 'use_icp2')), ... 
[100,300,250,400], ... 
str2num(getappdata(0, 'perform_pca')), ... 
str2num(getappdata(0, 'open_expressions')), ... 
getappdata(0, 'handle1'), ... 
getappdata(0, 'handle2'), ... 
getappdata(0, 'handle3'), ... 
getappdata(0, 'handle4'), ... 
str2num(getappdata(0, 'show_translation_mask')), ... 
getappdata(0, 'nose_finding_method'), ... 
str2num(getappdata(0, 'pseudo_sphere_radius')), ... 
str2num(getappdata(0, 'matching_iterator')), ... 
str2num(getappdata(0, 'measures_factor')), ... 
str2num(getappdata(0, 'show_shape_disrepency')), ... 
getappdata(0, 'residue_filtering_method'), ... 
str2num(getappdata(0, 'apply_hole_remover')), ... 
str2num(getappdata(0, 'perform_just_matching')), ... 
str2num(getappdata(0, 'matching_mode')), ... 
str2num(getappdata(0, 'circle_ratio')), ... 
getappdata(0, 'expressions_fileName'), ... 
getappdata(0, 'neutrals_fileName'));





% ==================================================================== %     

function initialize_gui(fig_handle, handles)

% this function will be called at the start and every time 'reset' is
% pressed

% The main routines will set values and strings, but some will shade
% sections in the GUI and initialise some button states and menus

% organisation and ordering of the statements might be useful.

% set the title

if (strcmp(getenv('OS'), 'Linux')),
  set(handles.Main_window, 'Name', [[get_package], [get_month], ' ', [get_year], ' - Version ', [get_version], ' - ', [getenv('OS')], ' on ', [get_host], '@ ', [get_domain]]);
       % if on Linux, display machine identifier
else
  set(handles.Main_window, 'Name', [[get_package], [get_month], ' ', [get_year], ' - Version ', [get_version], ' - ', [getenv('OS')]]);
end


% now draw the canvas

background = imread('backgroundlarge.jpg');

axes(handles.background);
axis off;
imshow(background,[0,255]);



draw_faces=1; % boolean, needed for handle intialisation too
draw_templates=0;

if (draw_faces)

  if (draw_templates)
    cd('~/pcafaces/Sample-data/2-D');
    sample_img1 = imread('img1.ppm');
    sample_img2 = imread('img2.ppm');
    sample_img4 = imread('img4.ppm');
    sample_img3 = imread('img3.ppm');
  end


  handle1=handles.axes16;

  if (draw_templates)
    axes(handle1);
    axis off;
    imshow(sample_img1,[0,255]);
  end


  handle2=handles.axes17;
  if (draw_templates)
    axes(handle2);
    axis off;
    imshow(sample_img2,[0,255]);
  end

  handle3=handles.axes18;

  if (draw_templates)
    axes(handle3);
    axis off;
    imshow(sample_img3,[0,255]);
  end


  handle4=handles.axes19;
  
  if (draw_templates)
    axes(handle4);  
    axis off;
    imshow(sample_img4,[0,255]);
  end

  setappdata(0, 'handle1', handle1); % save handle names for runtime
  setappdata(0, 'handle2', handle2);
  setappdata(0, 'handle3', handle3);
  setappdata(0, 'handle4', handle4);
end

set_defaults=1; % change only in case the GUI has something decent to start with

if (set_defaults)
  setappdata(0, '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
  setappdata(0, 'load_FRGC', '0'); % load NIST/FRGC-2.0 dataset (otherwise use a sample or use path with files)
  setappdata(0, 'open_expressions', '1'); % use expression files (GIP) rather than the NIST/FRGC-2.0 dataset

  % pre-processing

  setappdata(0, 'remove_bg_outliers', '1'); % post-process the image by removing bad data like holes and spikes
  setappdata(0, '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)
  setappdata(0, 'round_up_values', '0'); % change original values to be whole numbers (like integers)
  setappdata(0, 'apply_smoothing', '0'); % vertical and horizontal smoothing applied to original data (requires MATLAB toolbox for image analysis)

  % display and debugging

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

  setappdata(0, 'show_translation_mask', '1'); % whether to debug check of distance in X and Y axes


  % cropping method for face range

  setappdata(0, 'cropping_method', 'circle'); % 'rectangle', other methods, or otherwise assumed to be circle
  setappdata(0, '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)

  setappdata(0, 'nose_finding_method','nearest')
  % setappdata(0, 'nose_finding_method','nearcentre') % Search near centre by default
  % setappdata(0, 'nose_finding_method','sphere')
  setappdata(0, 'pseudo_sphere_radius','30')

  % cropping metrics for rigid areas to be selected

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

  % registration and modeling

  setappdata(0, 'use_icp2', '0'); % if 0, then ICPv1 will be used
  setappdata(0, 'perform_pca', '1'); % go through (or skip) the PCA phase


 % set up silders

  set(handles.nose_range_slider, 'Value',66)
  set(handles.skip_size_slider, 'Value',1)
  set(handles.frame_size_slider, 'Value',10)
  set(handles.pseudo_sphere_radius, 'Value',30)

  set(handles.nose_range_slider, 'Value',66)
  set(handles.cutoff_x_top_slider, 'Value',15)
  set(handles.cutoff_x_bottom_slider, 'Value',12)
  set(handles.cutoff_y_right_silder, 'Value',30)
  set(handles.cutoff_y_left_slider, 'Value',30)




  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % options to be added to interfaces (and maybe GUI) at some stage



    % Add to automation menu:

  setappdata(0, 'matching_iterator','0'); % the number of the probe image to fetch from the file and compare to a gallery in the other set of images (for matching phase, to be invoked externally for assessment); this can also be the starting image in a sequence (iterative mode), starting with 0, not 1.

  setappdata(0, 'measures_factor', '120'); % some scaling factor for expressions, adjusting to account for FRGC differences

  setappdata(0, 'show_shape_disrepency', '0'); % dispay a surface showing examples of differences visually (before and after), also show the mask to be applied

  setappdata(0, 'residue_filtering_method', 'binary_mask_and_threshold'); % 'binary_mask_and_threshold' by default, can be set to perform just one of the stages, e.g.  residue_filtering_method='threshold';

  setappdata(0, 'apply_hole_remover', '0'); % use as a filter InVision implementation

  setappdata(0, 'perform_just_matching', '0'); % somewhat deprecated, see option matching_mode
  setappdata(0, 'matching_mode', '1'); % also change below after loading old data

  setappdata(0, 'circle_ratio', '0.6'); % elliptic traits of the cropping coundaries (x/y ratio)

  setappdata(0, 'expressions_fileName', ' ');
  setappdata(0, 'neutrals_fileName', ' ');


end



% Advanced options handles

%  setappdata(0, 'close_handle', '0');
%  setappdata(0, 'exit_handle', '0');
%  setappdata(0, 'show_score_figures', '0');
%  setappdata(0, 'show_score_bar', '0');
%  
%  
%  
%  
%  setappdata(0, 'perturbation_offset', '0');
%  
%  setappdata(0, 'number_of_modes', '2');
%  setappdata(0, 'std', '2');
%  
%  setappdata(0, 'perturbation_method', 'random noise');
%  
%  % automation options
%  
%  setappdata(0, 'automation_type', 'None');
%  setappdata(0, 'minimum_value', '1');
%  setappdata(0, 'maximum_value', '1');
%  setappdata(0, 'step_size', '1');

% icons visibility menu options

set(handles.show_icons, 'Checked', 'on');
set(handles.hide_icons, 'Checked', 'off');




% main controls

set(handles.pause, 'Enable', 'off');
set(handles.resume, 'Enable', 'off');

% alignment and perturbation

% set(handles.perturb_option_button, 'Enable', 'off');
% set(handles.perturb_option_menuentry, 'Enable', 'off');







% set default background colours to required colour

setappdata(0, 'background_colour_red', '0.84');
setappdata(0, 'background_colour_green', '0.84');
setappdata(0, 'background_colour_blue', '1');








% set message in the status bar

message = [['GMDSPCA                                            '];
    ['                                                   '];
    ['                                                   '];
    ['                                                   '];          
    ['                                                   ']];

% set up a preliminary message to be sent to the status bar. please note
% that the message (matrix) must be rectangular.

set(handles.status_bar, 'String', message);

% set the status bar to display a welcoming message




% ==================================================================== % 

function icp(hObject, eventdata, handles)

setappdata(0, 'use_icp2', '0')
set(handles.icp1, 'Value', 1);
set(handles.icp2, 'Value', 0);

% ==================================================================== % 

function icp2(hObject, eventdata, handles)

setappdata(0, 'use_icp2', '1')
set(handles.icp1, 'Value', 0);
set(handles.icp2, 'Value', 1);





% ==================================================================== % 

% registration and modeling

function expressions(hObject, eventdata, handles)

if (str2num(getappdata(0, 'open_expressions')) == 1),
    setappdata(0, 'open_expressions', '0')
else
    setappdata(0, 'open_expressions', '1')
end    

% ==================================================================== % 



function FRGC(hObject, eventdata, handles)

if (str2num(getappdata(0, 'load_FRGC')) == 1),
    setappdata(0, 'load_FRGC', '0')
else
    setappdata(0, 'load_FRGC', '1')
end    





% ==================================================================== % 

% registration and modeling

function pca(hObject, eventdata, handles)

if (str2num(getappdata(0, 'perform_pca')) == 1),
    setappdata(0, 'perform_pca', '0')
else
    setappdata(0, 'perform_pca', '1')
end    

% ==================================================================== % 








% ==================================================================== % 

% pre-processing

function bg_outliers(hObject, eventdata, handles)

if (str2num(getappdata(0, 'remove_bg_outliers')) == 1),
    setappdata(0, 'remove_bg_outliers', '0')
else
    setappdata(0, 'remove_bg_outliers', '1')
end    

% ==================================================================== % 

function round_up(hObject, eventdata, handles)

if (str2num(getappdata(0, 'round_up_values')) == 1),
    setappdata(0, 'round_up_values', '0')
else
    setappdata(0, 'round_up_values', '1')
end    

% ==================================================================== % 

function apply_smoothing(hObject, eventdata, handles)

if (str2num(getappdata(0, 'apply_smoothing')) == 1),
    setappdata(0, 'apply_smoothing', '0')
else
    setappdata(0, 'apply_smoothing', '1')
end    

% ==================================================================== % 





function show_translation_mask(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_translation_mask')) == 1),
    setappdata(0, 'show_translation_mask', '0')
else
    setappdata(0, 'show_translation_mask', '1')
end    



function xy_images(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_xy_images')) == 1),
    setappdata(0, 'show_xy_images', '0')
else
    setappdata(0, 'show_xy_images', '1')
end    

% ==================================================================== % 

function show_data_again(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_data_again_after_normalisation')) == 1),
    setappdata(0, 'show_data_again_after_normalisation', '0')
else
    setappdata(0, 'show_data_again_after_normalisation', '1')
end    

% ==================================================================== % 

function histogram(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_histogram')) == 1),
    setappdata(0, 'show_histogram', '0')
else
    setappdata(0, 'show_histogram', '1')
end    

% ==================================================================== % 

function xy_diffs(hObject, eventdata, handles)

if (str2num(getappdata(0, 'plot_xy_diffs')) == 1),
    setappdata(0, 'plot_xy_diffs', '0')
else
    setappdata(0, 'plot_xy_diffs', '1')
end    

% ==================================================================== % 

function lighting(hObject, eventdata, handles)

if (str2num(getappdata(0, 'surface_lighting')) == 1),
    setappdata(0, 'surface_lighting', '0')
else
    setappdata(0, 'surface_lighting', '1')
end    

% ==================================================================== % 

function show_mesh(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_data_as_mesh')) == 1),
    setappdata(0, 'show_data_as_mesh', '0')
else
    setappdata(0, 'show_data_as_mesh', '1')
end    

% ==================================================================== % 



function show_surface(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_data_as_surfaces')) == 1),
    setappdata(0, 'show_data_as_surfaces', '0')
else
    setappdata(0, 'show_data_as_surfaces', '1')
end    

% ==================================================================== % 


function show_images(hObject, eventdata, handles)

if (str2num(getappdata(0, 'show_data_as_images')) == 1),
    setappdata(0, 'show_data_as_images', '0')
% str2num(getappdata(0, 'show_data_as_images'))
else
    setappdata(0, 'show_data_as_images', '1')
% str2num(getappdata(0, 'show_data_as_images'))
end    







% ==================================================================== % 

function Help_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function File_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function Exit_Callback(hObject, eventdata, handles)

close;

% ==================================================================== % 

function About_Callback(hObject, eventdata, handles)

about;

% ==================================================================== % 

function reset_Callback(hObject, eventdata, handles)

% reset invocation should result in the application returning to its
% starting state

initialize_gui(hObject, handles);

% ==================================================================== % 

function Matlab_Help_Callback(hObject, eventdata, handles)

% the internal helpdesk for MATLAB

helpdesk;

% ==================================================================== % 





% ==================================================================== % 

function status_bar_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function popupmenu2_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function popupmenu2_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function popupmenu3_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function popupmenu3_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function popupmenu4_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end





function pseudo_sphere_radius_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function pseudo_sphere_radius_Callback(hObject, eventdata, handles)

set(handles.pseudo_sphere_radius_text, 'String', num2str(ceil(get(handles.pseudo_sphere_radius, 'Value'))));
setappdata(0, 'pseudo_sphere_radius', num2str(ceil(get(handles.pseudo_sphere_radius, 'Value')))); 






function skip_size_slider_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function skip_size_slider_Callback(hObject, eventdata, handles)

set(handles.skip_size_text, 'String', num2str(ceil(get(handles.skip_size_slider, 'Value'))));
setappdata(0, 'skip_size', num2str(ceil(get(handles.skip_size_slider, 'Value')))); 





function frame_size_slider_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function frame_size_slider_Callback(hObject, eventdata, handles)

set(handles.frame_size_text, 'String', num2str(ceil(get(handles.frame_size_slider, 'Value'))));
setappdata(0, 'frame_size',  num2str(ceil(get(handles.frame_size_slider, 'Value'))));















function nose_range_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function nose_range_Callback(hObject, eventdata, handles)

set(handles.nose_range_text, 'String', num2str(ceil(get(handles.nose_range_slider, 'Value'))));
setappdata(0, 'nose_range',  num2str(ceil(get(handles.nose_range_slider, 'Value')))); 




function cutoff_x_top_slider_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function cutoff_x_top_slider_Callback(hObject, eventdata, handles)

set(handles.cutoff_x_top_text, 'String', num2str(ceil(get(handles.cutoff_x_top_slider, 'Value'))));
setappdata(0, 'cutoff_x_top',  num2str(ceil(get(handles.cutoff_x_top_slider, 'Value')))); 




function cutoff_x_bottom_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function cutoff_x_bottom_Callback(hObject, eventdata, handles)

set(handles.cutoff_x_bottom_text, 'String', num2str(ceil(get(handles.cutoff_x_bottom_slider, 'Value'))));
setappdata(0, 'cutoff_x_bottom',  num2str(ceil(get(handles.cutoff_x_bottom_slider, 'Value')))); 








function cutoff_y_right_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function cutoff_y_right_Callback(hObject, eventdata, handles)

set(handles.cutoff_y_right_text, 'String', num2str(ceil(get(handles.cutoff_y_right_silder, 'Value'))));
setappdata(0, 'cutoff_y_right',  num2str(ceil(get(handles.cutoff_y_right_silder, 'Value')))); 






function cutoff_y_left_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function cutoff_y_left_Callback(hObject, eventdata, handles)

set(handles.cutoff_y_left_text, 'String', num2str(ceil(get(handles.cutoff_y_left_slider, 'Value'))));
setappdata(0, 'cutoff_y_left',  num2str(ceil(get(handles.cutoff_y_left_slider, 'Value')))); 



















function Quit_MATLAB_Callback(hObject, eventdata, handles)

exit;

% ==================================================================== % 

function bug_Callback(hObject, eventdata, handles)

web http://schestowitz.com/Feedback

% ==================================================================== % 

function view_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function tools_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function exit_button_Callback(hObject, eventdata, handles)

close;

% ==================================================================== % 

function pause_Callback(hObject, eventdata, handles)

set(handles.pause, 'Enable', 'off');
set(handles.resume, 'Enable', 'on');
set(handles.status_bar, 'String', 'Registration paused');
uiwait;

% ==================================================================== % 

function resume_Callback(hObject, eventdata, handles)

set(handles.pause, 'Enable', 'on');
set(handles.resume, 'Enable', 'off');
uiresume;
set(handles.status_bar, 'String', 'Registration in progress...');

% ==================================================================== % 

function help_button_Callback(hObject, eventdata, handles)

helpdesk;

% ==================================================================== % 

function crop_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function crop(hObject, eventdata, handles)

contents = get(hObject,'String');

%  % cropping method for face range

if (strcmp(contents{get(hObject,'Value')},'Circle')),
    setappdata(0, 'cropping_method', 'circle');
elseif (strcmp(contents{get(hObject,'Value')},'Ellipsoid')),
    setappdata(0, 'cropping_method', 'ellipsoid');
elseif (strcmp(contents{get(hObject,'Value')},'Rectangle')),
    setappdata(0, 'cropping_method', 'rectangle');
else
    msgbox('Error with menu callback. Parameter passed is not recognised.');
end


% ==================================================================== % 


function nose_finding_method_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function nose_finding_method(hObject, eventdata, handles)

contents = get(hObject,'String');

%  % cropping method for face range

if (strcmp(contents{get(hObject,'Value')},'Nearest')),
    setappdata(0, 'nose_finding_method', 'nearest');
elseif (strcmp(contents{get(hObject,'Value')},'Sphere')),
    setappdata(0, 'nose_finding_method', 'sphere');
elseif (strcmp(contents{get(hObject,'Value')},'ICP')),
    setappdata(0, 'nose_finding_method', 'icp');
elseif (strcmp(contents{get(hObject,'Value')},'Viola-Jones')),
    setappdata(0, 'nose_finding_method', 'ViolaJones');
elseif (strcmp(contents{get(hObject,'Value')},'Search near centre')),
    setappdata(0, 'nose_finding_method', 'nearcentre');
else
    msgbox('Error with menu callback. Parameter passed is not recognised.');
end





% ==================================================================== % 

function Save_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function advanced_Callback(hObject, eventdata, handles)

% advanced;

% ==================================================================== % 

% Menu OPEN section

function open_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function status_mode_menu_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function options_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function score_model_by_menu_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function Technical_Callback(hObject, eventdata, handles)

technical;

% ==================================================================== % 

function advanced_button_Callback(hObject, eventdata, handles)

% advanced;

% ==================================================================== % 

function perturb_option_menuentry_Callback(hObject, eventdata, handles)

% perturb;

% ==================================================================== % 

function perturb_option_button_Callback(hObject, eventdata, handles)

% perturb;

% ==================================================================== % 

function cycle_slider_CreateFcn(hObject, eventdata, handles)

usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function Register_Callback(hObject, eventdata, handles)

register_1d_Callback(hObject, eventdata, handles);

% ==================================================================== % 

function Reset_Callback(hObject, eventdata, handles)

initialize_gui(hObject, handles);

% ==================================================================== % 

function automation_button_Callback(hObject, eventdata, handles)

automation;

% ==================================================================== % 

function automation_menu_Callback(hObject, eventdata, handles)

automation;

% ==================================================================== % 

function abort_Callback(hObject, eventdata, handles)

error('Registration Aborted');

% ==================================================================== % 

function verbose_disabled_Callback(hObject, eventdata, handles)

    set(handles.verbose_optimiser_flag, 'String', 'off');
    set(handles.verbose_disabled, 'Checked', 'on');
    set(handles.verbose_iteration, 'Checked', 'off');
    set(handles.verbose_notify, 'Checked', 'off');
    set(handles.verbose_final, 'Checked', 'off');

% ==================================================================== % 

function verbose_iterations_Callback(hObject, eventdata, handles)

    set(handles.verbose_optimiser_flag, 'String', 'iter');
    set(handles.verbose_disabled, 'Checked', 'off');
    set(handles.verbose_iteration, 'Checked', 'on');
    set(handles.verbose_notify, 'Checked', 'off');
    set(handles.verbose_final, 'Checked', 'off');

% ==================================================================== % 

function verbose_notify_Callback(hObject, eventdata, handles)

    set(handles.verbose_optimiser_flag, 'String', 'notify');
    set(handles.verbose_disabled, 'Checked', 'off');
    set(handles.verbose_iteration, 'Checked', 'off');
    set(handles.verbose_notify, 'Checked', 'on');
    set(handles.verbose_final, 'Checked', 'off');
    
% ==================================================================== % 

function verbose_final_Callback(hObject, eventdata, handles)

    set(handles.verbose_optimiser_flag, 'String', 'final');
    set(handles.verbose_disabled, 'Checked', 'off');
    set(handles.verbose_iteration, 'Checked', 'off');
    set(handles.verbose_notify, 'Checked', 'off');
    set(handles.verbose_final, 'Checked', 'on');

% ==================================================================== % 

function description_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function status_bar_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% ==================================================================== % 

function clear_status_bar_Callback(hObject, eventdata, handles)

set(handles.status_bar, 'String', '');

% ==================================================================== % 

function handle_clear_Callback(hObject, eventdata, handles)
set(handles.filename_handle, 'String', '');

% ==================================================================== % 

function desc_clear_Callback(hObject, eventdata, handles)
set(handles.description, 'String', '');

% ==================================================================== % 

function verbosity_normal_Callback(hObject, eventdata, handles)

setappdata(0, 'error_verbosity', 'normal');
set(handles.verbosity_low, 'Checked', 'off');
set(handles.verbosity_normal, 'Checked', 'on');
set(handles.verbosity_high, 'Checked', 'off');

% ==================================================================== % 

function verbosity_low_Callback(hObject, eventdata, handles)

setappdata(0, 'error_verbosity', 'low');
set(handles.verbosity_low, 'Checked', 'on');
set(handles.verbosity_normal, 'Checked', 'off');
set(handles.verbosity_high, 'Checked', 'off');

% ==================================================================== % 

function verbosity_high_Callback(hObject, eventdata, handles)

setappdata(0, 'error_verbosity', 'high');
set(handles.verbosity_low, 'Checked', 'off');
set(handles.verbosity_normal, 'Checked', 'off');
set(handles.verbosity_high, 'Checked', 'on');

% ==================================================================== % 

function error_verbosity_menu_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function input_output_menu_Callback(hObject, eventdata, handles)

% ==================================================================== % 

function set_background_colour_Callback(hObject, eventdata, handles)

RGB = uisetcolor;

% open dialog to select colour for background of plots


if (size(RGB, 2) == 3),
      % just in case the dialog was closed
	setappdata(0, 'background_colour_red', num2str(RGB(1)));
	setappdata(0, 'background_colour_green', num2str(RGB(2)));
	setappdata(0, 'background_colour_blue', num2str(RGB(3)));
end    


% ==================================================================== % 

function clone_menu_Callback(hObject, eventdata, handles)

  register;

% ==================================================================== % 

function clone_Callback(hObject, eventdata, handles)

  register;
  
% ==================================================================== % 

  function show_icons_Callback(hObject, eventdata, handles)

  set(handles.resume, 'cdata', playbutton);
  set(handles.pause, 'cdata', stopbutton);
  set(handles.register_1d, 'cdata', registerbutton);
  set(handles.help_button, 'cdata', helpbutton);
  set(handles.abort, 'cdata', abortbutton);
  set(handles.reset, 'cdata', resetbutton);
  
  set(handles.show_icons, 'Checked', 'on');
  set(handles.hide_icons, 'Checked', 'off');

% ==================================================================== % 

function hide_icons_Callback(hObject, eventdata, handles)

  set(handles.resume, 'cdata', []);
  set(handles.pause, 'cdata', []);
  set(handles.register_1d, 'cdata', []);
  set(handles.help_button, 'cdata', []);
  set(handles.abort, 'cdata', []);
  set(handles.reset, 'cdata', []);
  
  set(handles.show_icons, 'Checked', 'off');
  set(handles.hide_icons, 'Checked', 'on');
  

% ==================================================================== %  

function redefine_paths_Callback(hObject, eventdata, handles)
  
  path;
  pcapath;
  
% ==================================================================== %

function application_editor_Callback(hObject, eventdata, handles)

  msgbox('To prevent conflicting modifications, please contact Roy Schestowitz before making any changes.','Important Notification');
  mb;