[frames] | no frames]

# Module filters

source code

 Functions

 moredoc(*args) source code

 correlate1d(input, weights, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculate a one-dimensional correlation along the given axis. source code

 convolve1d(input, weights, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculate a one-dimensional convolution along the given axis. source code

 gaussian_filter1d(input, sigma, axis=-1, order=0, output=None, mode=`'``reflect``'`, cval=0.0) One-dimensional Gaussian filter. source code

 gaussian_filter(input, sigma, order=0, output=None, mode=`'``reflect``'`, cval=0.0) Multi-dimensional Gaussian filter. source code

 prewitt(input, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0) Calculate a Prewitt filter. source code

 sobel(input, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0) Calculate a Sobel filter. source code

 generic_laplace(input, derivative2, output=None, mode=`'``reflect``'`, cval=0.0, extra_arguments=`(``)`, extra_keywords=`{``}`) Calculate a multidimensional laplace filter using the provided second derivative function. source code

 laplace(input, output=None, mode=`'``reflect``'`, cval=0.0) Calculate a multidimensional laplace filter using an estimation for the second derivative based on differences. source code

 gaussian_laplace(input, sigma, output=None, mode=`'``reflect``'`, cval=0.0) Calculate a multidimensional laplace filter using gaussian second derivatives. source code

 generic_gradient_magnitude(input, derivative, output=None, mode=`'``reflect``'`, cval=0.0, extra_arguments=`(``)`, extra_keywords=`{``}`) Calculate a gradient magnitude using the provdide function for the gradient. source code

 gaussian_gradient_magnitude(input, sigma, output=None, mode=`'``reflect``'`, cval=0.0) Calculate a multidimensional gradient magnitude using gaussian derivatives. source code

 _correlate_or_convolve(input, weights, output, mode, cval, origin, convolution) source code

 correlate(input, weights, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Multi-dimensional correlation. source code

 convolve(input, weights, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Multi-dimensional convolution. source code

 uniform_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculate a one-dimensional uniform filter along the given axis. source code

 uniform_filter(input, size=3, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Multi-dimensional uniform filter. source code

 minimum_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculate a one-dimensional minimum filter along the given axis. source code

 maximum_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculate a one-dimensional maximum filter along the given axis. source code

 _min_or_max_filter(input, size, footprint, structure, output, mode, cval, origin, minimum) source code

 minimum_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculates a multi-dimensional minimum filter. source code

 maximum_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculates a multi-dimensional maximum filter. source code

 _rank_filter(input, rank, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0, operation=`'``rank``'`) source code

 rank_filter(input, rank, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculates a multi-dimensional rank filter. source code

 median_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculates a multi-dimensional median filter. source code

 percentile_filter(input, percentile, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0) Calculates a multi-dimensional percentile filter. source code

 generic_filter1d(input, function, filter_size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0, extra_arguments=`(``)`, extra_keywords=`{``}`) Calculate a one-dimensional filter along the given axis. source code

 generic_filter(input, function, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0, extra_arguments=`(``)`, extra_keywords=`{``}`) Calculates a multi-dimensional filter using the given function. source code
 Variables
_mode_doc = `'The mode parameter determines how the array borde...`
_origin_doc = `'\n\n The origin parameter controls the place...`
__package__ = `'ndimage'`

Imports: math, numpy, _ni_support, _nd_image

 Function Details

### correlate1d(input, weights, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculate a one-dimensional correlation along the given axis.

The lines of the array along the given axis are correlated with the given weights. The weights parameter must be a one-dimensional sequence of numbers.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### convolve1d(input, weights, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculate a one-dimensional convolution along the given axis.

The lines of the array along the given axis are convolved with the given weights. The weights parameter must be a one-dimensional sequence of numbers.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### gaussian_filter1d(input, sigma, axis=-1, order=0, output=None, mode=`'``reflect``'`, cval=0.0)

source code

One-dimensional Gaussian filter.

The standard-deviation of the Gaussian filter is given by sigma. An order of 0 corresponds to convolution with a Gaussian kernel. An order of 1, 2, or 3 corresponds to convolution with the first, second or third derivatives of a Gaussian. Higher order derivatives are not implemented.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### gaussian_filter(input, sigma, order=0, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Multi-dimensional Gaussian filter.

The standard-deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes. The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. An order of 1, 2, or 3 corresponds to convolution with the first, second or third derivatives of a Gaussian. Higher order derivatives are not implemented.'

Note: The multi-dimensional filter is implemented as a sequence of one-dimensional convolution filters. The intermediate arrays are stored in the same data type as the output. Therefore, for output types with a limited precision, the results may be imprecise because intermediate results may be stored with insufficient precision.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### prewitt(input, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Calculate a Prewitt filter.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### sobel(input, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Calculate a Sobel filter.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### generic_laplace(input, derivative2, output=None, mode=`'``reflect``'`, cval=0.0, extra_arguments=`(``)`, extra_keywords=`{``}`)

source code
```Calculate a multidimensional laplace filter using the provided
second derivative function.

The derivative2 parameter must be a callable with the following
signature:

derivative2(input, axis, output, mode, cval,
*extra_arguments, **extra_keywords)

The extra_arguments and extra_keywords arguments can be used to pass
extra arguments and keywords that are passed to derivative2 at each
call.

The mode parameter determines how the array borders are handled,
where cval is the value when mode is equal to 'constant'.  Other
modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

```
Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### laplace(input, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Calculate a multidimensional laplace filter using an estimation for the second derivative based on differences.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### gaussian_laplace(input, sigma, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Calculate a multidimensional laplace filter using gaussian second derivatives.

The standard-deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes..

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### generic_gradient_magnitude(input, derivative, output=None, mode=`'``reflect``'`, cval=0.0, extra_arguments=`(``)`, extra_keywords=`{``}`)

source code
```Calculate a gradient magnitude using the provdide function for

The derivative parameter must be a callable with the following
signature:

derivative(input, axis, output, mode, cval,
*extra_arguments, **extra_keywords)

The extra_arguments and extra_keywords arguments can be used to pass
extra arguments and keywords that are passed to derivative2 at each
call.

The mode parameter determines how the array borders are handled,
where cval is the value when mode is equal to 'constant'.  Other
modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

```
Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### gaussian_gradient_magnitude(input, sigma, output=None, mode=`'``reflect``'`, cval=0.0)

source code

Calculate a multidimensional gradient magnitude using gaussian derivatives.

The standard-deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes..

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### correlate(input, weights, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Multi-dimensional correlation.

The array is correlated with the given kernel.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### convolve(input, weights, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Multi-dimensional convolution.

The array is convolved with the given kernel.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### uniform_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculate a one-dimensional uniform filter along the given axis.

The lines of the array along the given axis are filtered with a uniform filter of given size.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### uniform_filter(input, size=3, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Multi-dimensional uniform filter.

The sizes of the uniform filter are given for each axis as a sequence, or as a single number, in which case the size is equal for all axes.

The multi-dimensional filter is implemented as a sequence of one-dimensional uniform filters. The intermediate arrays are stored in the same data type as the output. Therefore, for output types with a limited precision, the results may be imprecise because intermediate results may be stored with insufficient precision.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### minimum_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculate a one-dimensional minimum filter along the given axis.

The lines of the array along the given axis are filtered with a minimum filter of given size.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### maximum_filter1d(input, size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculate a one-dimensional maximum filter along the given axis.

The lines of the array along the given axis are filtered with a maximum filter of given size.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### minimum_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculates a multi-dimensional minimum filter.

Either a size or a footprint with the filter must be provided. An output array can optionally be provided.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### maximum_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculates a multi-dimensional maximum filter.

Either a size or a footprint with the filter must be provided. An output array can optionally be provided.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### rank_filter(input, rank, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculates a multi-dimensional rank filter.

The rank parameter may be less then zero, i.e., rank = -1 indicates the larges element. Either a size or a footprint with the filter must be provided. An output array can optionally be provided.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### median_filter(input, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculates a multi-dimensional median filter.

Either a size or a footprint with the filter must be provided. An output array can optionally be provided.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### percentile_filter(input, percentile, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0)

source code

Calculates a multi-dimensional percentile filter.

The percentile parameter may be less then zero, i.e., percentile = -20 equals percentile = 80. Either a size or a footprint with the filter must be provided. An output array can optionally be provided.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### generic_filter1d(input, function, filter_size, axis=-1, output=None, mode=`'``reflect``'`, cval=0.0, origin=0, extra_arguments=`(``)`, extra_keywords=`{``}`)

source code

Calculate a one-dimensional filter along the given axis.

The function iterates over the lines of the array, calling the given function at each line. The arguments of the line are the input line, and the output line. The input and output lines are 1D double arrays. The input line is extended appropiately according to the filter size and origin. The output line must be modified in-place with the result. The extra_arguments and extra_keywords arguments can be used to pass extra arguments and keywords that are passed to the function at each call.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

### generic_filter(input, function, size=None, footprint=None, output=None, mode=`'``reflect``'`, cval=0.0, origin=0, extra_arguments=`(``)`, extra_keywords=`{``}`)

source code

Calculates a multi-dimensional filter using the given function.

At each element the provided function is called. The input values within the filter footprint at that element are passed to the function as a 1D array of double values.

Either a size or a footprint with the filter must be provided. An output array can optionally be provided. The extra_arguments and extra_keywords arguments can be used to pass extra arguments and keywords that are passed to the function at each call.

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to 'constant'. Other modes are 'nearest', 'mirror', 'reflect' and 'wrap'.

The origin parameter controls the placement of the filter.

Decorators:
• `@moredoc(_mode_doc, _origin_doc)`

 Variables Details

### _mode_doc

Value:
 ````'''``The mode parameter determines how the array borders are handled,` ` where cval is the value when mode is equal to \'constant\'. Other` ` modes are \'nearest\', \'mirror\', \'reflect\' and \'wrap\'.``'''` ```

### _origin_doc

Value:
 ````'''` ` The origin parameter controls the placement of the filter.``'''` ```

 Generated by Epydoc 3.0.1 on Thu Jan 13 11:20:12 2011 http://epydoc.sourceforge.net