<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def crop_image(image, label_image=None, label=1):
 """ Use a label image to crop a smaller ANTsImage from within a larger ANTsImage ANTsR function: `cropImage` Arguments --------- image : ANTsImage image to crop label_image : ANTsImage image with label values. If not supplied, estimated from data. label : integer the label value to use Returns ------- ANTsImage Example ------- """

    inpixeltype = image.pixeltype
    ndim = image.dimension
    if image.pixeltype != 'float':
        image = image.clone('float')

    if label_image is None:
        label_image = get_mask(image)

    if label_image.pixeltype != 'float':
        label_image = label_image.clone('float')

    libfn = utils.get_lib_fn('cropImageF%i' % ndim)
    itkimage = libfn(image.pointer, label_image.pointer, label, 0, [], [])
    return iio.ANTsImage(pixeltype='float', dimension=ndim, 
                        components=image.components, pointer=itkimage).clone(inpixeltype)