def geometric_transform(input, mapping, output_shape=None, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True, extra_arguments=(), extra_keywords={}):
    "Apply an arbritrary geometric transform.\n\n    The given mapping function is used to find, for each point in the\n    output, the corresponding coordinates in the input. The value of the\n    input at those coordinates is determined by spline interpolation of\n    the requested order.\n\n    mapping must be a callable object that accepts a tuple of length\n    equal to the output array rank and returns the corresponding input\n    coordinates as a tuple of length equal to the input array\n    rank. Points outside the boundaries of the input are filled\n    according to the given mode ('constant', 'nearest', 'reflect' or\n    'wrap'). The output shape can optionally be given. If not given,\n    it is equal to the input shape. The parameter prefilter determines\n    if the input is pre-filtered before interpolation (necessary for\n    spline interpolation of order > 1).  If False it is assumed that\n    the input is already filtered. The extra_arguments and\n    extra_keywords arguments can be used to provide extra arguments\n    and keywords that are passed to the mapping function at each call.\n\n    Example\n    -------\n    >>> a = arange(12.).reshape((4,3))\n    >>> def shift_func(output_coordinates):\n    ...     return (output_coordinates[0]-0.5, output_coordinates[1]-0.5)\n    ...\n    >>> print geometric_transform(a,shift_func)\n    array([[ 0.    ,  0.    ,  0.    ],\n           [ 0.    ,  1.3625,  2.7375],\n           [ 0.    ,  4.8125,  6.1875],\n           [ 0.    ,  8.2625,  9.6375]])\n    "
    if ((order < 0) or (order > 5)):
        raise RuntimeError('spline order not supported')
    input = numpy.asarray(input)
    if numpy.iscomplexobj(input):
        raise TypeError('Complex type not supported')
    if (output_shape is None):
        output_shape = input.shape
    if ((input.ndim < 1) or (len(output_shape) < 1)):
        raise RuntimeError('input and output rank must be > 0')
    mode = _extend_mode_to_code(mode)
    if (prefilter and (order > 1)):
        filtered = spline_filter(input, order, output=numpy.float64)
    else:
        filtered = input
    (output, return_value) = _ni_support._get_output(output, input, output_type, shape=output_shape)
    _nd_image.geometric_transform(filtered, mapping, None, None, None, output, order, mode, cval, extra_arguments, extra_keywords)
    return return_value
Apply an arbritrary geometric transform.

The given mapping function is used to find, for each point in the
output, the corresponding coordinates in the input. The value of the
input at those coordinates is determined by spline interpolation of
the requested order.

mapping must be a callable object that accepts a tuple of length
equal to the output array rank and returns the corresponding input
coordinates as a tuple of length equal to the input array
rank. Points outside the boundaries of the input are filled
according to the given mode ('constant', 'nearest', 'reflect' or
'wrap'). The output shape can optionally be given. If not given,
it is equal to the input shape. The parameter prefilter determines
if the input is pre-filtered before interpolation (necessary for
spline interpolation of order > 1).  If False it is assumed that
the input is already filtered. The extra_arguments and
extra_keywords arguments can be used to provide extra arguments
and keywords that are passed to the mapping function at each call.

Example
-------
>>> a = arange(12.).reshape((4,3))
>>> def shift_func(output_coordinates):
...     return (output_coordinates[0]-0.5, output_coordinates[1]-0.5)
...
>>> print geometric_transform(a,shift_func)
array([[ 0.    ,  0.    ,  0.    ],
       [ 0.    ,  1.3625,  2.7375],
       [ 0.    ,  4.8125,  6.1875],
       [ 0.    ,  8.2625,  9.6375]])
def geometric_transform(input, mapping, output_shape=None, output_type=None, output=None, order=3, mode='constant', cval=0.0, prefilter=True, extra_arguments=(), extra_keywords={}):
    "Apply an arbritrary geometric transform.\n\n    The given mapping function is used to find, for each point in the\n    output, the corresponding coordinates in the input. The value of the\n    input at those coordinates is determined by spline interpolation of\n    the requested order.\n\n    mapping must be a callable object that accepts a tuple of length\n    equal to the output array rank and returns the corresponding input\n    coordinates as a tuple of length equal to the input array\n    rank. Points outside the boundaries of the input are filled\n    according to the given mode ('constant', 'nearest', 'reflect' or\n    'wrap'). The output shape can optionally be given. If not given,\n    it is equal to the input shape. The parameter prefilter determines\n    if the input is pre-filtered before interpolation (necessary for\n    spline interpolation of order > 1).  If False it is assumed that\n    the input is already filtered. The extra_arguments and\n    extra_keywords arguments can be used to provide extra arguments\n    and keywords that are passed to the mapping function at each call.\n\n    Example\n    -------\n    >>> a = arange(12.).reshape((4,3))\n    >>> def shift_func(output_coordinates):\n    ...     return (output_coordinates[0]-0.5, output_coordinates[1]-0.5)\n    ...\n    >>> print geometric_transform(a,shift_func)\n    array([[ 0.    ,  0.    ,  0.    ],\n           [ 0.    ,  1.3625,  2.7375],\n           [ 0.    ,  4.8125,  6.1875],\n           [ 0.    ,  8.2625,  9.6375]])\n    "
    if ((order < 0) or (order > 5)):
        raise RuntimeError('spline order not supported')
    input = numpy.asarray(input)
    if numpy.iscomplexobj(input):
        raise TypeError('Complex type not supported')
    if (output_shape is None):
        output_shape = input.shape
    if ((input.ndim < 1) or (len(output_shape) < 1)):
        raise RuntimeError('input and output rank must be > 0')
    mode = _extend_mode_to_code(mode)
    if (prefilter and (order > 1)):
        filtered = spline_filter(input, order, output=numpy.float64)
    else:
        filtered = input
    (output, return_value) = _ni_support._get_output(output, input, output_type, shape=output_shape)
    _nd_image.geometric_transform(filtered, mapping, None, None, None, output, order, mode, cval, extra_arguments, extra_keywords)
    return return_value