'Convert float data to valid RGB values in the range [0, 255]
Arguments:
img (ndarray): the image data
Returns:
img (ndarray): image array with valid RGB values'

def scale_to_rgb(self, img):

    img_min = np.min(img)
    img_rng = (np.max(img) - img_min)
    img_255 = (img - img_min)
    if (img_rng > 0):
        img_255 /= img_rng
        img_255 *= 255.0
    return img_255
