data_processing.image_analysis package
Submodules
data_processing.image_analysis.analysis_registry module
The dictionary with the name of the algorithms available in this folder.
data_processing.image_analysis.base_image_analyzer module
data_processing.image_analysis.cellpose module
- class data_processing.image_analysis.cellpose.Cellpose_algorithm(image, metadata, **analysis_details)[source]
Bases:
ImageAnalysisTemplateClass utilizing the Cellpose 3.0 algorithm for finding the objects on transmitted light and filter them by circularity, solidity and eccentricity.
- static filter_cellpose_masks(df, circ_thr=0.65, ecc_thr=0.5, sol_thr=0.85)[source]
Function for the filtration of the founded objects. :param df: pandas DF with the founded objects. :param circ_thr: float minimal circularity filtering threshold :param ecc_thr: float maximal eccentricity filtering threshold :param sol_thr: float maximal solidity filtering threshold :return: filtered pandas df
- image_segmentation(objects_diameter=None, circ_thr=0.65, ecc_thr=0.5, sol_thr=0.85)[source]
Initializing Cellpose algorithm. :param objects_diameter: float size in um, passed to Cellpose model eval :param circ_thr: float minimal circularity filtering threshold :param ecc_thr: float maximal eccentricity filtering threshold :param sol_thr: float maximal solidity filtering threshold :return: pandas df with objects center positions and their properties
data_processing.image_analysis.circles module
- class data_processing.image_analysis.circles.Circles(image, metadata, **analysis_details)[source]
Bases:
ImageAnalysisTemplateClass for detecting circular objects using Otsu thresholding and contour-based shape analysis.
- static get_contour_centers_and_radii(contours, min_fit_ratio)[source]
Compute centers and radii of contours fitting a circular shape. :return: dictionary mapping contour indices to center position, radius,
and fit ratio in pixel coordinates
data_processing.image_analysis.hexagonal_mesh module
- class data_processing.image_analysis.hexagonal_mesh.HexagonalMesh(image, metadata, **analysis_details)[source]
Bases:
ImageAnalysisTemplateClass utilizing the multi-Otsu algorhitm combined with the Delaunay algorithm for finding the nods and midpoints on hexagonal fluorescent mesh.
- get_mesh_nodes()[source]
Function for finding the nods of fluorescent mesh by multi-otsu thresholding. :return: numpy array of mesh node centroids in pixel coordinates
- get_delaunay_edges(points)[source]
Compute unique edges from Delaunay triangulation of given points. :return: numpy array of index pairs defining edges between points
- filter_edges_by_distance(points, edges, n_clusters=3, remove_outliers=False)[source]
Group edges by length using clustering, optionally removing long-distance outliers. :return: lists of edges grouped by distance, cluster centers, and edge cluster labels
- find_midpoints_and_centroids(points, n_clusters=3, remove_outliers=True)[source]
Find edge midpoints and polygon centroids based on clustered Delaunay edges. :return: numpy array of edge midpoints and array of polygon centroids
- get_measurement_points()[source]
Generate measurement points from mesh nodes, edge midpoints, and polygon centroids, and convert them to stage coordinates. :return: lists of dictionaries with the founded objects properties and their positions
in the pixels coordinates and in the stage coordinates in um
data_processing.image_analysis.pixel_stage_converter module
- data_processing.image_analysis.pixel_stage_converter.z_no_transform(px, stage_pos, scaling, tiles)[source]
Return Z position without applying any transformation. :return: float, stage Z position in um
- data_processing.image_analysis.pixel_stage_converter.z_normal(px, stage_pos, scaling, tiles)[source]
Return Z position adjusted by pixel Z offset and scaling. :return: float, stage Z position in um
- class data_processing.image_analysis.pixel_stage_converter.PixelStageConverter(metadata, image_shape)[source]
Bases:
objectConvert pixel coordinates to stage coordinates in X, Y, and Z.
Uses image metadata for scaling and optional tile/Z-scan information.
- convert_xy(px, mode='normal')[source]
Convert pixel X,Y to stage coordinates using scaling and image center. :return: tuple (x_stage, y_stage) in um
- convert_z_auto(px)[source]
Automatically choosing the strategy based on metadata to convert pixel Z to stage Z based on Z-scan or tiles. :return: float, stage Z position in um
data_processing.image_analysis.z_scan_max_intensity module
- class data_processing.image_analysis.z_scan_max_intensity.Max_intensity_Z_Scan(image, metadata, **analysis_details)[source]
Bases:
ImageAnalysisTemplateCLass for finding the measurement points at maximum intensity along Z axis.