Skip to main content

CellMet is cell segmentation shape analysis library

Project description

CellMet

A generalist algorithm to analyse cell shape from 3D labeled image.

This code is made to analyse cell shape from 3D labeled image. It is divide in three parts:

  • Prerequisite that will create image containing one cell. This is mandatory to fasten the following analysis.
  • We determine edges and faces associated to each cell. Quality of this analysis is dependant of the quality of the labeled image. There is no segmentation correction.
  • Analysis of cells, faces and edges.

There is a Python API to allow user to integrate CellMet into your custom workflow.

Input/Output and datas organisation

Input

In order to be able to use this project. You first need to segment you image using CellPose (or any other software that gives 3D label image). You need to be satisfied by your label image, since there is no manual correction (only filter can be apply to remove cells that has a volume below a threshold for example).
Then, you can perform 3D cell segmentation with CellMet.

Output and datas organisation

You can generate ply/obj file for each cells.

Datas are organised as half-edge structures. The vertex, edge, face and cell tables are interconnected to represent and navigate through the mesh's elements.

image

We generate 7 csv files, that can be populated later during the analysis part. - __cell_df.csv__ contains measure relative to the cell, such as volume, number of neighbours, orientation, curvature - __cell_plane_df.csv__ contains plane measure, such as orientation, anisotropy, area, perimeter - __edge_df.csv__ contains measure relative to the edge such as length (real & shortest), curvature, the 3 connected cells - __edge_pixel_df.csv__ contains pixels coordinates of each edge and the 3 connected cells - __face_df.csv__ contains coordinates of the middle of the face, the lengths, the angles - __face_edge_pixel_df.csv__ contains coordinates of the edges associated to the face, and the coordinates of the middle of the face - __face_pixel_df.csv__ contains pixels coordinates of each face and the 2 connected cells and edges

Prerequisite

It creates two folders names "npz" and "obj_mesh" that stores numpy array of binary one cell image and ply/obj file of each cell respectively. npz file are mandatory for the analyse, while obj_mesh allows to visualise cells in 3D with Blender. All files are named after the cell id in the original image.

Segmentation

This part consists of analysing the labelled image in order to determine neighbouring relationship between cells; contact between two cells (i.e. face); contact between three cells (i.e. edge).

Analysis

Cell information (cell_df.csv)

  • Volume $vol_c=nb_{pixel}*voxel_{size}$
  • Coordinate of line in the middle of the cell : $mid_{line}$
  • Real distance of $mid_{line}$ : $D_r$
  • Short distance of $mid_{line}$ : $D_s$
  • Curvature index $1-(D_s/D_r)$
  • Cell plane information (cell_plane.csv)

    Plane measure :
  • Anisotropy $major/minor$
  • Orientation $\alpha = arctan2(y_orient/x_orient)$
  • Area
  • Perimeter
  • Edge information (edge_df.csv)

    • Real distance $D_r$
    • Short distance $D_s$
    • Curvature index $1-(D_s/D_r)$

    Face information (face_df.csv)

    :warning: Only lateral face (coloured face in scheme)
  • id of cell1 & cell2
  • id of edge1 & edge2
  • Centre of the face
  • Width
  • Angles (reference: centre of the face)
  • Install

    See INSTALL.md for a step by step install.

    Troubleshooting

    Kernel crash due to lack of memory: reduce the number of core used for parallelized task.

    Roadmap

    • Add GUI with python or as a Napari plugin

    Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    cellmet-1.0.0.tar.gz (60.9 kB view details)

    Uploaded Source

    Built Distribution

    CellMet-1.0.0-py3-none-any.whl (48.4 kB view details)

    Uploaded Python 3

    File details

    Details for the file cellmet-1.0.0.tar.gz.

    File metadata

    • Download URL: cellmet-1.0.0.tar.gz
    • Upload date:
    • Size: 60.9 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/5.1.1 CPython/3.12.7

    File hashes

    Hashes for cellmet-1.0.0.tar.gz
    Algorithm Hash digest
    SHA256 a1ba71779c0e79988156e19e793de2cf173297eab8b0512396fdc508082e3aa1
    MD5 9869dd1433ecee487191c1929684dcb9
    BLAKE2b-256 ce338ff4c6570fba7f27d5aee0d8fe42e2a74618edb60db3456926725a3d4f74

    See more details on using hashes here.

    File details

    Details for the file CellMet-1.0.0-py3-none-any.whl.

    File metadata

    • Download URL: CellMet-1.0.0-py3-none-any.whl
    • Upload date:
    • Size: 48.4 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/5.1.1 CPython/3.12.7

    File hashes

    Hashes for CellMet-1.0.0-py3-none-any.whl
    Algorithm Hash digest
    SHA256 9f6c8099377b04b203ed58c302c81c0c5cf694f19ac84b9d303483855e96e060
    MD5 47a659e1f805bd5429abe6c5aa2fe0a3
    BLAKE2b-256 6b82dbf81375b7fbea90adc2bcd58a5ea1c801884074dceaa032937b8be0338e

    See more details on using hashes here.

    Supported by

    AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page