<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_nibabel(nib_image):
 """ Convert a nibabel image to an ANTsImage """

    tmpfile = mktemp(suffix='.nii.gz')
    nib_image.to_filename(tmpfile)
    new_img = iio2.image_read(tmpfile)
    os.remove(tmpfile)
    return new_img