def crop_center(img,cropx,cropy,cropz):
    """
    Crops out the center of a 3D volume
    """
    x,y,z = img.shape
    startx = x//2-(cropx//2)
    starty = y//2-(cropy//2)
    startz = z//2-(cropz//2) 
    return img[startx:startx+cropx,starty:starty+cropy,startz:startz+cropz]