neulab/docprompting-conala huggingface dataset:
skimage.filters.gaussian(image, sigma=1, output=None, mode='nearest', cval=0, multichannel=None, preserve_range=False, truncate=4.0) [source]
 
Multi-dimensional Gaussian filter.  Parameters 
 
imagearray-like 

Input image (grayscale or color) to filter.  
sigmascalar or sequence of scalars, optional 

Standard deviation for Gaussian kernel. 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.  
outputarray, optional 

The output parameter passes an array in which to store the filter output.  
mode{‘reflect’, ‘constant’, ‘nearest’, ‘mirror’, ‘wrap’}, optional 

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’. Default is ‘nearest’.  
cvalscalar, optional 

Value to fill past edges of input if mode is ‘constant’. Default is 0.0  
multichannelbool, optional (default: None) 

Whether the last axis of the image is to be interpreted as multiple channels. If True, each channel is filtered separately (channels are not mixed together). Only 3 channels are supported. If None, the function will attempt to guess this, and raise a warning if ambiguous, when the array has shape (M, N, 3).  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html  
truncatefloat, optional 

Truncate the filter at this many standard deviations.    Returns 
 
filtered_imagendarray 

the filtered array     Notes This function is a wrapper around scipy.ndi.gaussian_filter(). Integer arrays are converted to float. The output should be floating point data type since gaussian converts to float provided image. If output is not provided, another array will be allocated and returned as the result. 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. Examples >>> a = np.zeros((3, 3))
>>> a[1, 1] = 1
>>> a
array([[0., 0., 0.],
       [0., 1., 0.],
       [0., 0., 0.]])
>>> gaussian(a, sigma=0.4)  # mild smoothing
array([[0.00163116, 0.03712502, 0.00163116],
       [0.03712502, 0.84496158, 0.03712502],
       [0.00163116, 0.03712502, 0.00163116]])
>>> gaussian(a, sigma=1)  # more smoothing
array([[0.05855018, 0.09653293, 0.05855018],
       [0.09653293, 0.15915589, 0.09653293],
       [0.05855018, 0.09653293, 0.05855018]])
>>> # Several modes are possible for handling boundaries
>>> gaussian(a, sigma=1, mode='reflect')
array([[0.08767308, 0.12075024, 0.08767308],
       [0.12075024, 0.16630671, 0.12075024],
       [0.08767308, 0.12075024, 0.08767308]])
>>> # For RGB images, each is filtered separately
>>> from skimage.data import astronaut
>>> image = astronaut()
>>> filtered_img = gaussian(image, sigma=1, multichannel=True)
skimage.filters.hessian(image, sigmas=range(1, 10, 2), scale_range=None, scale_step=None, alpha=0.5, beta=0.5, gamma=15, black_ridges=True, mode=None, cval=0) [source]
 
Filter an image with the Hybrid Hessian filter. This filter can be used to detect continuous edges, e.g. vessels, wrinkles, rivers. It can be used to calculate the fraction of the whole image containing such objects. Defined only for 2-D and 3-D images. Almost equal to Frangi filter, but uses alternative method of smoothing. Refer to [1] to find the differences between Frangi and Hessian filters.  Parameters 
 
image(N, M[, P]) ndarray 

Array with input image data.  
sigmasiterable of floats, optional 

Sigmas used as scales of filter, i.e., np.arange(scale_range[0], scale_range[1], scale_step)  
scale_range2-tuple of floats, optional 

The range of sigmas used.  
scale_stepfloat, optional 

Step size between sigmas.  
betafloat, optional 

Frangi correction constant that adjusts the filter’s sensitivity to deviation from a blob-like structure.  
gammafloat, optional 

Frangi correction constant that adjusts the filter’s sensitivity to areas of high variance/texture/structure.  
black_ridgesboolean, optional 

When True (the default), the filter detects black ridges; when False, it detects white ridges.  
mode{‘constant’, ‘reflect’, ‘wrap’, ‘nearest’, ‘mirror’}, optional 

How to handle values outside the image borders.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.    Returns 
 
out(N, M[, P]) ndarray 

Filtered image (maximum of pixels across all scales).      See also  
meijering


sato


frangi

  Notes Written by Marc Schrijver (November 2001) Re-Written by D. J. Kroon University of Twente (May 2009) [2] References  
1  
Ng, C. C., Yap, M. H., Costen, N., & Li, B. (2014,). Automatic wrinkle detection using hybrid Hessian filter. In Asian Conference on Computer Vision (pp. 609-622). Springer International Publishing. DOI:10.1007/978-3-319-16811-1_40  
2  
Kroon, D. J.: Hessian based Frangi vesselness filter.
skimage.filters.inverse(data, impulse_response=None, filter_params={}, max_gain=2, predefined_filter=None) [source]
 
Apply the filter in reverse to the given data.  Parameters 
 
data(M,N) ndarray 

Input data.  
impulse_responsecallable f(r, c, **filter_params) 

Impulse response of the filter. See LPIFilter2D.__init__.  
filter_paramsdict 

Additional keyword parameters to the impulse_response function.  
max_gainfloat 

Limit the filter gain. Often, the filter contains zeros, which would cause the inverse filter to have infinite gain. High gain causes amplification of artefacts, so a conservative limit is recommended.    Other Parameters 
 
predefined_filterLPIFilter2D 

If you need to apply the same filter multiple times over different images, construct the LPIFilter2D and specify it here.
skimage.filters.laplace(image, ksize=3, mask=None) [source]
 
Find the edges of an image using the Laplace operator.  Parameters 
 
imagendarray 

Image to process.  
ksizeint, optional 

Define the size of the discrete Laplacian operator such that it will have a size of (ksize,) * image.ndim.  
maskndarray, optional 

An optional mask to limit the application to a certain area. Note that pixels surrounding masked regions are also masked to prevent masked regions from affecting the result.    Returns 
 
outputndarray 

The Laplace edge map.     Notes The Laplacian operator is generated using the function skimage.restoration.uft.laplacian().
class skimage.filters.LPIFilter2D(impulse_response, **filter_params) [source]
 
Bases: object Linear Position-Invariant Filter (2-dimensional)  
__init__(impulse_response, **filter_params) [source]
 
 Parameters 
 
impulse_responsecallable f(r, c, **filter_params) 

Function that yields the impulse response. r and c are 1-dimensional vectors that represent row and column positions, in other words coordinates are (r[0],c[0]),(r[0],c[1]) etc. **filter_params are passed through. In other words, impulse_response would be called like this: >>> def impulse_response(r, c, **filter_params):
...     pass
>>>
>>> r = [0,0,0,1,1,1,2,2,2]
>>> c = [0,1,2,0,1,2,0,1,2]
>>> filter_params = {'kw1': 1, 'kw2': 2, 'kw3': 3}
>>> impulse_response(r, c, **filter_params)
     Examples Gaussian filter: Use a 1-D gaussian in each direction without normalization coefficients. >>> def filt_func(r, c, sigma = 1):
...     return np.exp(-np.hypot(r, c)/sigma)
>>> filter = LPIFilter2D(filt_func)
__init__(impulse_response, **filter_params) [source]
 
 Parameters 
 
impulse_responsecallable f(r, c, **filter_params) 

Function that yields the impulse response. r and c are 1-dimensional vectors that represent row and column positions, in other words coordinates are (r[0],c[0]),(r[0],c[1]) etc. **filter_params are passed through. In other words, impulse_response would be called like this: >>> def impulse_response(r, c, **filter_params):
...     pass
>>>
>>> r = [0,0,0,1,1,1,2,2,2]
>>> c = [0,1,2,0,1,2,0,1,2]
>>> filter_params = {'kw1': 1, 'kw2': 2, 'kw3': 3}
>>> impulse_response(r, c, **filter_params)
     Examples Gaussian filter: Use a 1-D gaussian in each direction without normalization coefficients. >>> def filt_func(r, c, sigma = 1):
...     return np.exp(-np.hypot(r, c)/sigma)
>>> filter = LPIFilter2D(filt_func)
skimage.filters.median(image, selem=None, out=None, mode='nearest', cval=0.0, behavior='ndimage') [source]
 
Return local median of an image.  Parameters 
 
imagearray-like 

Input image.  
selemndarray, optional 

If behavior=='rank', selem is a 2-D array of 1’s and 0’s. If behavior=='ndimage', selem is a N-D array of 1’s and 0’s with the same number of dimension than image. If None, selem will be a N-D array with 3 elements for each dimension (e.g., vector, square, cube, etc.)  
outndarray, (same dtype as image), optional 

If None, a new array is allocated.  
mode{‘reflect’, ‘constant’, ‘nearest’, ‘mirror’,’‘wrap’}, optional 

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’. Default is ‘nearest’.  New in version 0.15: mode is used when behavior='ndimage'.   
cvalscalar, optional 

Value to fill past edges of input if mode is ‘constant’. Default is 0.0  New in version 0.15: cval was added in 0.15 is used when behavior='ndimage'.   
behavior{‘ndimage’, ‘rank’}, optional 

Either to use the old behavior (i.e., < 0.15) or the new behavior. The old behavior will call the skimage.filters.rank.median(). The new behavior will call the scipy.ndimage.median_filter(). Default is ‘ndimage’.  New in version 0.15: behavior is introduced in 0.15   Changed in version 0.16: Default behavior has been changed from ‘rank’ to ‘ndimage’     Returns 
 
out2-D array (same dtype as input image) 

Output image.      See also  
skimage.filters.rank.median


Rank-based implementation of the median filtering offering more flexibility with additional parameters but dedicated for unsigned integer images.    Examples >>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filters import median
>>> img = data.camera()
>>> med = median(img, disk(5))
skimage.filters.meijering(image, sigmas=range(1, 10, 2), alpha=None, black_ridges=True, mode='reflect', cval=0) [source]
 
Filter an image with the Meijering neuriteness filter. This filter can be used to detect continuous ridges, e.g. neurites, wrinkles, rivers. It can be used to calculate the fraction of the whole image containing such objects. Calculates the eigenvectors of the Hessian to compute the similarity of an image region to neurites, according to the method described in [1].  Parameters 
 
image(N, M[, …, P]) ndarray 

Array with input image data.  
sigmasiterable of floats, optional 

Sigmas used as scales of filter  
alphafloat, optional 

Frangi correction constant that adjusts the filter’s sensitivity to deviation from a plate-like structure.  
black_ridgesboolean, optional 

When True (the default), the filter detects black ridges; when False, it detects white ridges.  
mode{‘constant’, ‘reflect’, ‘wrap’, ‘nearest’, ‘mirror’}, optional 

How to handle values outside the image borders.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.    Returns 
 
out(N, M[, …, P]) ndarray 

Filtered image (maximum of pixels across all scales).      See also  
sato


frangi


hessian

  References  
1  
Meijering, E., Jacob, M., Sarria, J. C., Steiner, P., Hirling, H., Unser, M. (2004). Design and validation of a tool for neurite tracing and analysis in fluorescence microscopy images. Cytometry Part A, 58(2), 167-176. DOI:10.1002/cyto.a.20022
skimage.filters.prewitt(image, mask=None, *, axis=None, mode='reflect', cval=0.0) [source]
 
Find the edge magnitude using the Prewitt transform.  Parameters 
 
imagearray 

The input image.  
maskarray of bool, optional 

Clip the output image to this mask. (Values where mask=0 will be set to 0.)  
axisint or sequence of int, optional 

Compute the edge filter along this axis. If not provided, the edge magnitude is computed. This is defined as: prw_mag = np.sqrt(sum([prewitt(image, axis=i)**2
                       for i in range(image.ndim)]) / image.ndim)
 The magnitude is also computed if axis is a sequence.  
modestr or sequence of str, optional 

The boundary mode for the convolution. See scipy.ndimage.convolve for a description of the modes. This can be either a single boundary mode or one boundary mode per axis.  
cvalfloat, optional 

When mode is 'constant', this is the constant used in values outside the boundary of the image data.    Returns 
 
outputarray of float 

The Prewitt edge map.      See also  
sobel, scharr

  Notes The edge magnitude depends slightly on edge directions, since the approximation of the gradient operator by the Prewitt operator is not completely rotation invariant. For a better rotation invariance, the Scharr operator should be used. The Sobel operator has a better rotation invariance than the Prewitt operator, but a worse rotation invariance than the Scharr operator. Examples >>> from skimage import data
>>> from skimage import filters
>>> camera = data.camera()
>>> edges = filters.prewitt(camera)
skimage.filters.prewitt_h(image, mask=None) [source]
 
Find the horizontal edges of an image using the Prewitt transform.  Parameters 
 
image2-D array 

Image to process.  
mask2-D array, optional 

An optional mask to limit the application to a certain area. Note that pixels surrounding masked regions are also masked to prevent masked regions from affecting the result.    Returns 
 
output2-D array 

The Prewitt edge map.     Notes We use the following kernel:  1/3   1/3   1/3
  0     0     0
-1/3  -1/3  -1/3
skimage.filters.prewitt_v(image, mask=None) [source]
 
Find the vertical edges of an image using the Prewitt transform.  Parameters 
 
image2-D array 

Image to process.  
mask2-D array, optional 

An optional mask to limit the application to a certain area. Note that pixels surrounding masked regions are also masked to prevent masked regions from affecting the result.    Returns 
 
output2-D array 

The Prewitt edge map.     Notes We use the following kernel: 1/3   0  -1/3
1/3   0  -1/3
1/3   0  -1/3
skimage.filters.rank.autolevel(image, selem, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False) [source]
 
Auto-level image using local histogram. This filter locally stretches the histogram of gray values to cover the entire range of values from “white” to “black”.  Parameters 
 
image([P,] M, N) ndarray (uint8, uint16) 

Input image.  
selemndarray 

The neighborhood expressed as an ndarray of 1’s and 0’s.  
out([P,] M, N) array (same dtype as input) 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_y, shift_zint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out([P,] M, N) ndarray (same dtype as input image) 

Output image.     Examples >>> from skimage import data
>>> from skimage.morphology import disk, ball
>>> from skimage.filters.rank import autolevel
>>> import numpy as np
>>> img = data.camera()
>>> volume = np.random.randint(0, 255, size=(10,10,10), dtype=np.uint8)
>>> auto = autolevel(img, disk(5))
>>> auto_vol = autolevel(volume, ball(5))
skimage.filters.rank.autolevel_percentile(image, selem, out=None, mask=None, shift_x=False, shift_y=False, p0=0, p1=1) [source]
 
Return greyscale local autolevel of an image. This filter locally stretches the histogram of greyvalues to cover the entire range of values from “white” to “black”. Only greyvalues between percentiles [p0, p1] are considered in the filter.  Parameters 
 
image2-D array (uint8, uint16) 

Input image.  
selem2-D array 

The neighborhood expressed as a 2-D array of 1’s and 0’s.  
out2-D array (same dtype as input) 

If None, a new array is allocated.  
maskndarray 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_yint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).  
p0, p1float in [0, …, 1] 

Define the [p0, p1] percentile interval to be considered for computing the value.    Returns 
 
out2-D array (same dtype as input image) 

Output image.
skimage.filters.rank.bottomhat(image, selem, out=None, mask=None, shift_x=False, shift_y=False) [source]
 
Local bottom-hat of an image. This filter computes the morphological closing of the image and then subtracts the result from the original image.  Parameters 
 
image2-D array (integer or float) 

Input image.  
selem2-D array (integer or float) 

The neighborhood expressed as a 2-D array of 1’s and 0’s.  
out2-D array (integer or float), optional 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_yint, optional 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out2-D array (same dtype as input image) 

Output image.    Warns 
 Deprecated:

 New in version 0.17.  This function is deprecated and will be removed in scikit-image 0.19. This filter was misnamed and we believe that the usefulness is narrow.     Examples >>> from skimage import data
>>> from skimage.morphology import disk
>>> from skimage.filters.rank import bottomhat
>>> img = data.camera()
>>> out = bottomhat(img, disk(5))
skimage.filters.rank.enhance_contrast(image, selem, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False) [source]
 
Enhance contrast of an image. This replaces each pixel by the local maximum if the pixel gray value is closer to the local maximum than the local minimum. Otherwise it is replaced by the local minimum.  Parameters 
 
image([P,] M, N) ndarray (uint8, uint16) 

Input image.  
selemndarray 

The neighborhood expressed as an ndarray of 1’s and 0’s.  
out([P,] M, N) array (same dtype as input) 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_y, shift_zint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out([P,] M, N) ndarray (same dtype as input image) 

Output image     Examples >>> from skimage import data
>>> from skimage.morphology import disk, ball
>>> from skimage.filters.rank import enhance_contrast
>>> import numpy as np
>>> img = data.camera()
>>> volume = np.random.randint(0, 255, size=(10,10,10), dtype=np.uint8)
>>> out = enhance_contrast(img, disk(5))
>>> out_vol = enhance_contrast(volume, ball(5))
skimage.filters.rank.enhance_contrast_percentile(image, selem, out=None, mask=None, shift_x=False, shift_y=False, p0=0, p1=1) [source]
 
Enhance contrast of an image. This replaces each pixel by the local maximum if the pixel greyvalue is closer to the local maximum than the local minimum. Otherwise it is replaced by the local minimum. Only greyvalues between percentiles [p0, p1] are considered in the filter.  Parameters 
 
image2-D array (uint8, uint16) 

Input image.  
selem2-D array 

The neighborhood expressed as a 2-D array of 1’s and 0’s.  
out2-D array (same dtype as input) 

If None, a new array is allocated.  
maskndarray 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_yint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).  
p0, p1float in [0, …, 1] 

Define the [p0, p1] percentile interval to be considered for computing the value.    Returns 
 
out2-D array (same dtype as input image) 

Output image.
skimage.filters.rank.entropy(image, selem, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False) [source]
 
Local entropy. The entropy is computed using base 2 logarithm i.e. the filter returns the minimum number of bits needed to encode the local gray level distribution.  Parameters 
 
image([P,] M, N) ndarray (uint8, uint16) 

Input image.  
selemndarray 

The neighborhood expressed as an ndarray of 1’s and 0’s.  
out([P,] M, N) array (same dtype as input) 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_y, shift_zint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out([P,] M, N) ndarray (float) 

Output image.     References  
1  
https://en.wikipedia.org/wiki/Entropy_(information_theory)   Examples >>> from skimage import data
>>> from skimage.filters.rank import entropy
>>> from skimage.morphology import disk, ball
>>> import numpy as np
>>> img = data.camera()
>>> volume = np.random.randint(0, 255, size=(10,10,10), dtype=np.uint8)
>>> ent = entropy(img, disk(5))
>>> ent_vol = entropy(volume, ball(5))
skimage.filters.rank.equalize(image, selem, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False) [source]
 
Equalize image using local histogram.  Parameters 
 
image([P,] M, N) ndarray (uint8, uint16) 

Input image.  
selemndarray 

The neighborhood expressed as an ndarray of 1’s and 0’s.  
out([P,] M, N) array (same dtype as input) 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_y, shift_zint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out([P,] M, N) ndarray (same dtype as input image) 

Output image.     Examples >>> from skimage import data
>>> from skimage.morphology import disk, ball
>>> from skimage.filters.rank import equalize
>>> import numpy as np
>>> img = data.camera()
>>> volume = np.random.randint(0, 255, size=(10,10,10), dtype=np.uint8)
>>> equ = equalize(img, disk(5))
>>> equ_vol = equalize(volume, ball(5))
skimage.filters.rank.geometric_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False) [source]
 
Return local geometric mean of an image.  Parameters 
 
image([P,] M, N) ndarray (uint8, uint16) 

Input image.  
selemndarray 

The neighborhood expressed as an ndarray of 1’s and 0’s.  
out([P,] M, N) array (same dtype as input) 

If None, a new array is allocated.  
maskndarray (integer or float), optional 

Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (default).  
shift_x, shift_y, shift_zint 

Offset added to the structuring element center point. Shift is bounded to the structuring element sizes (center must be inside the given structuring element).    Returns 
 
out([P,] M, N) ndarray (same dtype as input image) 

Output image.     References  
1  
Gonzalez, R. C. and Wood, R. E. “Digital Image Processing (3rd Edition).” Prentice-Hall Inc, 2006.   Examples >>> from skimage import data
>>> from skimage.morphology import disk, ball
>>> from skimage.filters.rank import mean
>>> import numpy as np
>>> img = data.camera()
>>> volume = np.random.randint(0, 255, size=(10,10,10), dtype=np.uint8)
>>> avg = geometric_mean(img, disk(5))
>>> avg_vol = geometric_mean(volume, ball(5))