Software for 3D microscopy image analysis combining classical Computer Vision in Java with deep-learning segmentation in Python.
- Bio-Formats image reading
- microscopy metadata extraction
- 3D intensity-volume generation
- threshold-based 3D segmentation
- StarDist deep-learning segmentation
- stack overlay visualization
- automated unit tests
- Java/Python execution through TIFF files
organoid-3d-segmenter/
├── java-app/ Java image analysis and Python launcher
├── python-deep-learning/ StarDist segmentation and visualization
├── test-data/ Lightweight sample microscopy data for manual examples
├── results/ Generated outputs
├── model-cache/ Local StarDist model cache
└── README.md
Java unit tests and small Java image-reading examples use synthetic TIFF files from:
java-app/src/test/resources/
Manual examples that should run on a real microscopy crop use:
test-data/organoid_stack_sample_crop.tif
Use the repository root as working directory for both Java and Python:
organoid-3d-segmenter
Example on Windows:
D:/my/path/organoid-3d-segmenter
Do not use java-app or python-deep-learning as working directory when running examples from IntelliJ, Spyder or the terminal.
Run from IntelliJ:
com.organoid.examples.RunJavaThresholdSegmentation
The input image and threshold are configured in:
java-app/config/threshold-segmentation.properties
Example:
input.path=test-data/organoid_stack_sample_crop.tif
segmentation.threshold=210.0Paths are resolved from the repository root. The example reads the configured image, applies threshold-based segmentation, shows the resulting mask stack, and prints the foreground voxel count.
Run from IntelliJ:
com.organoid.examples.ReadImageMetadata
com.organoid.examples.ReadImageFile
com.organoid.examples.ShowRawImageStack
These examples use small synthetic TIFF files stored in:
java-app/src/test/resources/
Expected synthetic files:
synthetic_rgb_image.tif
synthetic_3d_stack.tif
From the repository root:
python python-deep-learning/examples/run_stardist_segmentation.pyRun from IntelliJ:
com.organoid.examples.RunPythonSegmentation
Java starts the Python StarDist workflow, which reads the input TIFF and writes the label TIFF.
Use Python 3.11.
Use an existing Python environment containing the dependencies listed in:
python-deep-learning/requirements.txt
Example setup:
conda activate tensorflow_stardist
pip install -r python-deep-learning/requirements.txtFind the Python interpreter on Windows:
where pythonCopy:
config/python-integration.properties.example
to:
config/python-integration.properties
Set the returned interpreter path:
python.interpreter=C:/path/to/python.exeJava threshold segmentation:
java-app/config/threshold-segmentation.properties
Java/Python execution:
config/python-integration.properties
Python StarDist segmentation and viewer:
python-deep-learning/config/stardist_segmentation.toml
Run Java tests from the repository root:
cd java-app
mvn clean testRun Python tests from the repository root:
python -m pytest python-deep-learning/tests -vJava tests use lightweight synthetic TIFF fixtures. Python unit tests do not require a real StarDist model, TensorFlow execution, model downloads or large image files.
Open the repository folder:
organoid-3d-segmenter
Import the Maven project from:
java-app/pom.xml
For Java run configurations, set:
Working directory:
D:/my/path/organoid-3d-segmenter