if arr.ndim == 3:
        dz, dy, dx = arr.shape
        if (dz == 0) or (dy == 0) or (dx == 0):
            raise ValueError("The length of one of dimensions is equal to zero")
    else: