This repository contains supplementary scripts for preparing data for the MMV_H4Cells napari plugin.
For detailed plugin information, please refer to the MMV_H4Cells README.
-
Install Anaconda.
If you’re new to Anaconda, check out the getting started guide or this cheat sheet (PDF). -
Clone this repository:
git clone https://github.com/MMV-Lab/mmv_h4cells_helper.git cd mmv_h4cells_helper💡 If you don’t have Git installed, click the green Code button → Download ZIP, then unzip it and navigate to the extracted folder.
-
Create and activate a new conda environment:
conda create --name mmv_h4cells_helper python=3.9 conda activate mmv_h4cells_helper
Install the required packages via pip:
pip install cellpose aicsimageioAlternatively, use the provided requirements file:
pip install -r requirements.txt(If installation fails, ensure your conda environment is active.)
For GPU acceleration, follow the official Cellpose GPU installation guide.
An example dataset is included under data/raw/sample.tif to help you understand the workflow.
-
Navigate to the project folder
cd path/to/mmv_h4cells_helper -
Run segmentation
- Segment cells:
python inference_cells.py
- Segment nuclei:
python inference_nuclei.py
- Segment cells:
-
Match cell and nucleus masks Generate a merged mask containing only cells that fully enclose at least one nucleus:
python get_double_positives.py
The result will be saved in the
results/folder as<filename>_merged.tif.
You can visualize and further process it using napari with the MMV_H4Cells plugin. -
Process your own data To analyze custom
.tiffiles, place them in thedata/raw/directory and rerun the above commands.
This project is licensed under the MIT License.
See the LICENSE file for details.