GithubHelp home page GithubHelp logo

3d_nuclei_segmentation's Introduction

Spheroid 3D nucleus segmentation library written in Python

3D Spheroid nucleus segmentation software written in Python. You can easily run and get the volume, label, centroid of the nucleus in the spheroid and many more.

How to use

What you need is

  • Python Environment (Python 3.9.0 or higher)
  • 3D image of a spheroid (usually .tif)

Install

  1. Install Python 3.9.0 or higher
  2. Clone this repository
  3. In the directory, run the following command to install required dependencies
pip3 install -r requirements.txt

Set settings.json

see settings_example.json

  1. You need to set at least these properties to run the segmentation
  • "img_path": ".../spheroid.tif", Input 3D image, make sure it is single-channel 3D nuclei image (.tif).
  • "output_dir": ".../output", Output directory to save the segmentation results.
  1. After you set the values, rename settings_example.json to settings.json.

Run

In the directory, run

python3 main.py

See the Result

Generated files are like these.

Screen Shot 2023-04-03 at 11 25 51

You can see the results in your output_dir. It contains .pkl file for later your analysis. The .pkl file can be loaded using Python pickle library. It contains properties that you set in the settings.json for each nucleus segmented in the image. Also, the settings.json is saved to check what parameters you used in the analysis. .npy file is a segmented 3D image in numpy format, each nucleus region is annotated as different integers. The .csv file is not needed if you use .pkl file, as it is more handy for Python. But in case you don't use Python for post processing, you can use .csv.

  "properties": [
    "area",
    "centroid",
    "axis_major_length",
    "axis_minor_length",
    "image",
    "inertia_tensor_eigvals",
    "moments_central"
  ],

For example, by using pandas.read_pickle(), you can get this segmentation results.

Screen Shot 2023-04-03 at 11 21 50

Debug

In settings.json, you can set debug: true and you can visualize the segmentation process step by step like below using napari library. For more info, please have a look at https://napari.org/stable/.

Screen Shot 2023-04-03 at 11 31 05

Troubleshooting

not working when debug is true

run

brew install PyQt

3d_nuclei_segmentation's People

Contributors

takaria0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.