clear all;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Parameters section


%%%%%%%%%%%%%%%%%%%%%%%%
% File parameters

training_set_path = '~/Model_Evaluation/images/hand_annotated_brain_training_tfc';

synthesis_set_path = '~/Model_Evaluation/images/24022005/Sigma/3';

type_training='*.pnm';

type_synthesis='*.jpg';
  
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%
% Display

show_images = 0;
  % specifies whether images should be displayed in run-time
  
%%%%%%%%%%%%%%%%%%%%%%%%
  
%%%%%%%%%%%%%%%%%%%%%%%%
% Smoothing
  
smoothing_filter_size = 3;
  % size of smoothing filter to apply (value<1 disables it)
filter_type = 'gaussian';
  % can be 'box' or 'gaussian'
smooth_all_images = 0;
  % whether all /original/ images should be smoothed
smooth_difference_image = 0;
  % whether smoothing should be applied to difference image
    
%%%%%%%%%%%%%%%%%%%%%%%%
  
%%%%%%%%%%%%%%%%%%%%%%%%
% Brightness
  
scale_brightness = 1;
  % whether or not brightness should be set (in display) according to highest difference
  % detected
    
%%%%%%%%%%%%%%%%%%%%%%%%
  
%%%%%%%%%%%%%%%%%%%%%%%%
% Distance Measure
  
calculate_fast_shuffle_distance_circle = 1;
  % Uses Marsland's/Petrovic's shuffle distance metric
  % Most options are not available in this mode
  
shuffle_radius = 3;
  % radius for the above
  
  % alternatives - used only if the above is not set  
  
squared_differences = 0;
  % difference in intensities to be raised to the power of 2

distance_of_power_2_in_difference_image = 0;
  % whether or not differences should be raised to the power of 2 when
  % evaluating mean difference
 
calculate_shuffle_distance_square = 1;
  % whether difference should be shuffle distance-based (it is otherwise
  % simple intensity based (squared if
  % distance_of_power_2_in_difference_image is set)
  
shuffle_window = 3;
  % window size for shuffle distance  
  
%%%%%%%%%%%%%%%%%%%%%%%%
  
%%%%%%%%%%%%%%%%%%%%%%%%
% Image sizes
  
resize_training_set = 1;
  % whether training set needs to be resized
resize_synthesis_set = 1;
  % whether training set needs to be resized 
  
resize_width = 255;
resize_height = 255;
   % size to set images to if resize if enabled
    
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%
% Focus

focus = 1;
  % whether background should be cropped

threshold = 60;
  % cropping threshold for brain, minus means reverse condition (for light
  % background)
  
%%%%%%%%%%%%%%%%%%%%%%%%
  
%%%%%%%%%%%%%%%%%%%%%%%%
% Boundary Cropping 

crop_frame_from_synthesis = 0;
  % crop the edges from synthesis image

crop_width = 15;
  % upper bound on the size of black edges in synthetic images


crop_boundaries_from_training = 0;
  % crop the boundaries of training images; can potentially save
  % computation time in finding skin

crop_width_training = 10;
  % upper bound on the size of black edges in synthetic images
  
%%%%%%%%%%%%%%%%%%%%%%%%
  

save_filename='Matrix_shuf7x7';
  % the filename where data will be saved
  
% End of parameters section 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
  
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Pack and pass all arguments to the function   
  
evaluate_model_from_synthesis_and_training_set( ...
			training_set_path, ...
			synthesis_set_path, ... 
			type_training, ...
			type_synthesis, ...
			show_images, ... 
			smoothing_filter_size, ... 
			filter_type, ...
			smooth_all_images, ...
			smooth_difference_image, ... 
			scale_brightness, ... 
			calculate_fast_shuffle_distance_circle, ... 
			shuffle_radius, ...
			squared_differences, ... 
			distance_of_power_2_in_difference_image, ... 
			calculate_shuffle_distance_square, ...
			shuffle_window, ... 
			resize_training_set, ...
			resize_synthesis_set, ...
			resize_width, ... 
			resize_height, ... 
			focus, ...
			threshold, ... 
			crop_frame_from_synthesis, ... 
            crop_width, ...
			crop_boundaries_from_training, ...
			crop_width_training, ...
            save_filename);