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.
What you need is
- Python Environment (Python 3.9.0 or higher)
- 3D image of a spheroid (usually .tif)
- Install Python 3.9.0 or higher
- Clone this repository
- In the directory, run the following command to install required dependencies
pip3 install -r requirements.txt
see settings_example.json
- 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.
- After you set the values, rename
settings_example.json
tosettings.json
.
In the directory, run
python3 main.py
Generated files are like these.
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.
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/.
run
brew install PyQt