Server module

Server.aft_processing(filename, protype, proc_cmd)

After the specific image processing, this function process all the information regarding this image. After processing, this would return a image array including the corresponding information of the image, including: base64 str of the images, filename, id, process type, time stamp, time duration and processed histograms. :param filename: str of the name of the image :param protype: list of the post-processed image histogram :param proc_cmd: the str of process command which would be Reverse Video, Contrast Stretching, Log Compression and Histogram Equalization.

Returns:a python array contains all the information fo the image after

processing, including base64 str of the processed images, filename, id, process type, time stamp, time duration and processed histograms.

Return type:an array with string value
Server.app_get_user(user_email)

app_get_user Function takes the user_email input from the user, which help user to get his own images data from database with all the images information. :param email: str of the user email

Server.create_user()

create_user Function takes the user_email input from the user including their setting email and their names. This function store and establish the user profile in the database. :param email: str of the user email :param name: str of the user name

Server.get_user(user_email)
Server.images_post()

images_post Function takes the input from the user such as email, images and the image filename, which performs the desired pre-processing on the image and saves as an array containing image information to the database.

Parameters:
  • email – str of the user email
  • images – base64 string of the images with headers from front-end
  • filename – the str of images name as its specific identification
Server.pro_images_post(email, filename)

pro_images_post Function takes the input from the user such as email, images the image filename as identification and process type command, which performs the desired processing procedure on the image and saves as an array containing image information to the database.

Parameters:
  • email – str of the user email
  • process – process types of command
  • images – base64 string of the images with headers from front-end
  • filename – the str of images name as its specific identification
Server.rm_strheader(images)

Remove the header of the images base64 string from front-end :param images: the input should be the base64 string of the image :raises TypeError: if input is not a string

Returns:base64 string without data header
Return type:string
Server.transfer_decode(image_str)

Remove the header of the images base64 bytes from front-end :param image_str: the input should be the base64 bytes of the image

Returns:base64 string without data header
Return type:string