perch.structure

Classes

Structure([pi, id, id_ph, img_shape, sdir])

Class for storing information about a topological structure in an image.

class perch.structure.Structure(pi=None, id=None, id_ph=None, img_shape=None, sdir='./')

Bases: object

Class for storing information about a topological structure in an image.

Parameters

piarray-like

Array of persistence information. The first element is the homology type, the second is the birth time, the third is the death time, the next three are the birth pixel coordinates, and the last three are the death pixel coordinates.

idint

Unique identifier for the structure, in the subset of selected structures.

id_phint

Unique identifier for the structure, in the full persistence diagram.

img_shapetuple

Shape of the image the structure is segmented from.

sdirstr

Directory to save/load structure information.

compute_segment(img)

Compute the segmentation of the structure in the image.

Parameters

imgarray-like

Image to segment the structure from.

get_mask()

Get mask of the structure.

get_values(img=None)

Get image values of the structure.

Parameters

imgarray-like

Image to get values from.