StatMomentsDistance

class turbustat.statistics.StatMomentsDistance(image1, image2, radius=5, nbins=None, periodic1=False, periodic2=False, fiducial_model=None)[source] [edit on github]

Bases: object

Compute the distance between two images based on their moments. The distance is calculated for the skewness and kurtosis. The distance values for each for computed using the Hellinger Distance (default), or the Kullback-Leidler Divergence.

Unlike the other distance classes in TurbuStat, the computation of the histograms needed for the distance metric has been split into its own method. However, the change is fairly transparent, since it is called within distance_metric.

Parameters:

image1 : numpy.ndarray

2D Image.

image2 : numpy.ndarray

2D Image.

radius : int, optional

Radius of circle to use when computing moments.

nbins : int, optional

Number of bins to use when constructing histograms.

periodic1 : bool, optional

If image1 is periodic in the spatial boundaries, set to True.

periodic2 : bool, optional

If image2 is periodic in the spatial boundaries, set to True.

fiducial_model : StatMoments

Computed StatMoments object. use to avoid recomputing.

Methods Summary

Methods Documentation

distance_metric(metric='Hellinger', verbose=False, nbins=None)[source] [edit on github]

Compute the distance.

Parameters:

metric : ‘Hellinger’ (default) or “KL Divergence”, optional

Set the metric to use compare the histograms.

verbose : bool, optional

Enables plotting.

nbins : int, optional

Bins to use in the histogram calculation.