medpy.filter.houghtransform.ght#

medpy.filter.houghtransform.ght(img, template)[source]#

Implementation of the general hough transform for all dimensions.

Providing a template, this method searches in the image for structures similar to the one depicted by the template. The returned hough image denotes how well the structure fit in each index.

The indices of the returned image correspond with the centers of the template. At the corresponding locations of the original image the template is applied (like a stamp) and the underlying voxel values summed up to form the hough images value. It is suggested to normalize the input image before for speaking results.

This function behaves as the general hough transform if a binary image has been supplied. In the case of a gray-scale image, the values of the pixels under the templates structure are summed up, thus weighting becomes possible.

Parameters:
imgarray_like

The image in which to search for the structure.

templatearray_like

A boolean array containing the structure to search for.

Returns:
hough_transformndarray

The general hough transformation image.

Notes

The center of a structure with odd side-length is simple the arrays middle. When an even-sided array has been supplied as template, the middle rounded down is taken as the structures center. This means that in the second case the hough image is shifted by half a voxel (\(ndim * [-0.5]\)).