import cv2
import numpy as np



def load_img_array(img_list, image_size=512):
    '''
    Parameters
    ----------
    img_list : list
        paths to image slicres.
    image_size : int
        represent the image size like 256 or 512.

    Returns
    -------
    img_array : array
        stack of slices.

    '''
    img_array = []
    for item in img_list:
        img_arr =  cv2.imread(item)
        img_arr = cv2.cvtColor(img_arr, cv2.COLOR_BGR2RGB)
        img_arr = img_arr/255.
        img_arr = img_arr.astype(np.float32)
        img_array.append(img_arr)
    
    return img_array