mfjet.calculator_mf_euclidean module#

A module containing MF calculators for Euclidean geometry

class mfjet.calculator_mf_euclidean.MFEuclideanCalculator(quad_segs=8)#

Bases: object

Minkowski functional calculator for the persistent analysis with Steiner-type formula in Euclidean geometry.

Parameters:

quad_segs (int, default 8) – The default number of linear segments in a quarter circle in the approximation of circular arcs. This number will be used as quad_segs param in shapely.buffer method if quad_segs is not provided to member funtions.

calc_mfs(coords, r, quad_segs=None)#

Compute MFs given points dilated by a disk with radius r.

Parameters:
  • coords (array_like with shape (N_pt, 2))

  • r (float or array_like) – The circle radius in the Minkowski sum.

  • quad_segs (int, default 8) – The number of linear segments in a quarter circle in the approximation of circular arcs.

Returns:

array of Minkowski functionals given r. The last index k is labeling $k$-th Minkiwski functionals

  • k=0: Euler characteristic

  • k=1: Boundary length

  • k=2: Area

Return type:

np.array with shape (3,) or (r.shape, 3)

dilate_points_by_disk(coords, r, quad_segs=None)#

Dilate given points by a disk with radius r. This dilation function is for Steiner-type formula for Euclidean distance.

Parameters:
  • coords (array_like with shape (N_pt, 2))

  • r (float) – The circle radius in the Minkowski sum.

  • quad_segs (int, default 8) – The number of linear segments in a quarter circle in the approximation of circular arcs.

Returns:

geometry object representing dilated points

Return type:

shapely.Polygon or shapely.MultiPolygon