% save segmented images

function store_segmented_images(dg_in, dg_out_int ,dg_out_ext ,ca1_in ,ca1_out ,ca3_in ,ca3_out ,...
    ca1_border_int ,ca1_border_ext ,ca3_border_int ,ca3_border_ext ,dg_border_int ,dg_border_ext, image_name, SEGMENTED_HOME_FOLDER)

    tmp_filename = sprintf('%s/ca1_in/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca1_in, tmp_filename, 'png');
    tmp_filename = sprintf('%s/ca1_out/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca1_out, tmp_filename, 'png');
    tmp_filename = sprintf('%s/ca3_in/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca3_in, tmp_filename, 'png');
    tmp_filename = sprintf('%s/ca3_out/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca3_out, tmp_filename, 'png');
    tmp_filename = sprintf('%s/dg_in/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(dg_in, tmp_filename, 'png');
    
    tmp_filename = sprintf('%s/dg_border_int/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(dg_border_int, tmp_filename, 'png');
    tmp_filename = sprintf('%s/dg_border_ext/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(dg_border_ext, tmp_filename, 'png');
    
    tmp_filename = sprintf('%s/ca1_border_int/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca1_border_int, tmp_filename, 'png');
    tmp_filename = sprintf('%s/ca1_border_ext/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca1_border_ext, tmp_filename, 'png');
    
    tmp_filename = sprintf('%s/ca3_border_int/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca3_border_int, tmp_filename, 'png');
    tmp_filename = sprintf('%s/ca3_border_ext/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(ca3_border_ext, tmp_filename, 'png');    
    
    tmp_filename = sprintf('%s/dg_out_int/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(dg_out_int, tmp_filename, 'png');
    tmp_filename = sprintf('%s/dg_out_ext/%s.png',SEGMENTED_HOME_FOLDER,image_name);
    imwrite(dg_out_ext, tmp_filename, 'png');    
end