ActImgBinary#
Warning
This library and its documentation are still under development.
This section documents the ActImgBinary class, its methods, and helpers.
ActImgBinary class and attributes#
- meshure.actimg_binary.ActImgBinary(image_stack: ndarray = None, title: str = None, shape: tuple = None, depth: int = None, deconvolved: bool = None, resolution: float = None, meta: dict = None, manipulated_stack: array = None, manipulated_depth: int = 0, binary_mesh: ndarray = None) None#
ActImgBinary is a class which helps quantify the actin mesh in binary images. … .. attribute:: binary_mesh
- type:
np.array=None
ActImgBinary methods#
- meshure.actimg_binary.ActImgBinary.surface_area(self, n_dilations_erosions: tuple = (3, 4), closing_structure: bool | None = None, extra_dilate_fill: bool = True, verbose: bool = False, return_outpt: bool = False)#
Returns the surface area and associated units. Note: the algorithm uses serial dilations to include the periphery of the cell even if the cell boundary is discontinuous. The dilations are followed by an equivalent number of serial erosions to avoid overestimating the cell area. Note: it is assumed that the largest object in the field of view is the cell which is to be segmented.
- Return type:
if the cell is not segmented, this is recorded separately
- meshure.actimg_binary.ActImgBinary.mesh_density(self, verbose: bool = False, return_outpt: bool = False)#
Returns the mesh density as a % value. This is defined as the percentage of the mesh / filled_cell_surface Note: the outline is included in the calculation. This does not necessarily match the image signal in the case of discontinuous cell surfaces.
- meshure.actimg_binary.ActImgBinary.peripheral_mesh_density(self, verbose: bool = False, return_outpt: bool = False)#
Returns the peripheral mesh density as a % value. This is defined as [ 100 * actin_mesh_area / (filled_cell_surface - largest hole in cell) ] Note: the outline is included in the calculation.
- meshure.actimg_binary.ActImgBinary.mesh_holes_area(self, unit: str = 'um', saturation_area: float | None = None, visualise: bool = False, return_outp: bool = False, scale_bar: bool = True, bar_locate: str = 'upper left')#
Returns the labels by area and visualises mesh holes coloured by area size with specified unit and saturation
- meshure.actimg_binary.ActImgBinary.visualise_segmentation(self, save: bool = False, dest_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/actinmeshure/checkouts/latest/docs/source', scale_bar: bool = True, bar_locate: str = 'upper left')#
Visualise the segmentation steps: binary mesh, cell surface, mesh holes.
- Parameters:
save (bool=False) – Save plot to dest_dir. Displayed but not saved by default.
dest_dir (str=os.getcwd()) – Directory to save plot in (defaults to current working directory)
colmap (str='inferno') – Change color map (passed to cmap argument) in matplotlib.pyplot. Perceptually uniform colour map used by default.
scale_bar (bool=True) – Adding a scale bar to images by default (provided, resolution is available).
bar_locate (str='upper_left') – Position of scale bar; upper left by default.
- Returns:
A tiled plot of three panels: binary mesh (mask), cell surface (filled cell contour), mesh holes (inverted mask).
- Return type:
matplotlib.pyplot
- meshure.actimg_binary.ActImgBinary.quantify_mesh(self)#
- meshure.actimg_binary.ActImgBinary.save_estimated_parameters(self, dest_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/actinmeshure/checkouts/latest/docs/source')#
Saves estimated parameters in JSON and CSV format.
- Parameters:
dest_dir (str or Path) – Path of destination where the JSON file should be saved; defaults to current working directory.
- Return type:
A JSON and/or CSV file with the estimated parameters in the ActImgBinary object and the resolution-related parameters from self.resolution.
- meshure.actimg_binary.ActImgBinary.save_log(self, dest_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/actinmeshure/checkouts/latest/docs/source', dest_file: str | None = None)#
ActImgBinary helpers#
- meshure.actimg_binary.get_ActImgBinary(actimg)#
Returns an ActImgBinary instance given a related ActImg.
- Parameters:
actimg (ActImg) – An instance of the ActImg class.