Cell segmentation and feature extraction on the Whitehead HPC using Cellpose.
- Segmentation modes: nuclei-only, cells-only, or dual (both)
- Feature extraction: CellProfiler-equivalent morphological and intensity features
- File formats: TIFF, Nikon ND2, DeltaVision (.dv)
- Cellpose 3 & 4: Supports both versions with automatic model selection
# Clone the repository on fry
git clone https://github.com/cheeseman-lab/goudacell.git
cd goudacell
# Create the environment
conda create -n goudacell -c conda-forge python=3.11 uv pip -y
conda activate goudacell
# Install goudacell (choose ONE):
uv pip install -e ".[cellpose3]" # For most cells (rounded shapes)
uv pip install -e ".[cellpose4]" # For complex cell shapes
# Register as a Jupyter kernel
python -m ipykernel install --user --name goudacell --display-name "goudacell"# Start Jupyter on a GPU node (run from goudacell directory)
cd /path/to/goudacell
sbatch scripts/jupyter_gpu.sh
# Check the output file for the URL
cat goudacell_jupyter-*.outOpen the notebook at notebooks/segmentation.ipynb and:
- Set your image directory and file pattern
- Choose segmentation mode:
"nuclei","cells", or"dual" - Adjust parameters (diameter, thresholds) using the sweep cells
- Run feature extraction (optional)
- Generate batch config when happy with results
# Use the config file generated by the notebook
sbatch scripts/run_segmentation.sh /path/to/segmentation_config.yaml| Mode | Output | Use case |
|---|---|---|
nuclei |
*_nuclei_mask.tif |
Nuclear segmentation only |
cells |
*_mask.tif |
Cell segmentation only |
dual |
*_nuclei_mask.tif + *_cell_mask.tif |
Both nuclei and cells |
Extract CellProfiler-equivalent features from segmented images (~100+ features per compartment):
- Intensity: mean, std, min, max, median, quartiles, edge intensities
- Shape: area, perimeter, solidity, eccentricity, Zernike/Hu moments
- Texture: Haralick (13), PFTAS (54)
- Distribution: radial intensity distribution
- Correlation: channel correlation, colocalization metrics
- Neighbors: counts, distances, angles
- Foci: count and area per channel (optional)
| Version | Install with | Use for |
|---|---|---|
| Cellpose 3 | .[cellpose3] |
Round cells (most common) |
| Cellpose 4 | .[cellpose4] |
Irregular/complex shapes |
- TIFF (
.tif,.tiff) - Nikon ND2 (
.nd2) - DeltaVision (
.dv)