{ } Raw JSON

bundles / skimage latest / skimage / morphology / _grayreconstruct / reconstruction_loop

fused_cython_function

skimage.morphology._grayreconstruct:reconstruction_loop

Signature

def   reconstruction_loop ( ranks prev next strides current_idx image_stride )

Summary

The inner loop for reconstruction.

Extended Summary

This algorithm uses the rank-order of pixels. If low intensity pixels have a low rank and high intensity pixels have a high rank, then this loop performs reconstruction by dilation. If this ranking is reversed, the result is reconstruction by erosion.

For each pixel in the seed image, check its neighbors. If its neighbor's rank is below that of the current pixel, replace the neighbor's rank with the rank of the current pixel. This dilation is limited by the mask, i.e. the rank at each pixel cannot exceed the mask as that pixel.

Parameters

ranks : array

The rank order of the flattened seed and mask images.

prev, next: arrays

Indices of previous and next pixels in rank sorted order.

strides : array

Strides to neighbors of the current pixel.

current_idx : int

Index of highest-ranked pixel used as starting point in loop.

image_stride : int

Stride between seed image and mask image in aranks.

Aliases

  • skimage.morphology._grayreconstruct.reconstruction_loop