PhenoPixel is a backend + frontend app for microscopy cell extraction and
batch analytics. The backend exposes APIs under /api/v1, and the frontend
provides a UI for running workflows.
The montage below shows a population-level fluorescence overview from two channels, rendered as a GFP / mCherry-style double-stained overlay. It combines the green and magenta fluorescence layers without scale bars, with display intensity balanced across cells while avoiding saturation.
This repository is maintained to support reproducible reporting in research papers. If you cite this software in a manuscript, please include:
- Software name: PhenoPixel
- Author: Yunosuke Ikeda
- Contact: d263846@hiroshima-u.ac.jp
- Repository URL: (this repository URL)
- Version evidence: Git commit hash used in the analysis
- Access date: date you accessed the repository
Ikeda, Y. PhenoPixel: microscopy single-cell extraction and batch phenotype analysis software.
GitHub repository. URL: <repository-url> (accessed <YYYY-MM-DD>), commit <commit-hash>.
When linking this repository in a paper, we strongly recommend reporting:
- Runtime environment (OS, Python, Node.js versions)
- Exact backend/frontend dependency snapshots
- Input image format and acquisition conditions (e.g., ND2 metadata)
- Analysis parameters (Canny thresholds, ROI size, channel count, Auto Annotation on/off)
- Labeling protocol used in Annotation (
Label 1criteria) - Bulk Engine mode(s), threshold(s), and export settings
- Exact PhenoPixel commit hash used for generating results
Manage ND2 files in this page: upload new datasets, delete existing ones, and select a specific ND2 file to proceed to Cell Extraction.
- Configure extraction. For the selected ND2 file, choose the Canny algorithm parameters, ROI crop size, number of fluorescence layers, and whether Auto Annotation is on or off. Press
Extract cellsto start the extraction run.
- Auto annotation behavior. When Auto Annotation is
On, an additional post-processing step runs after extraction to automatically separate cells from debris.
The current implementation is a contour-only heuristic. After a contour Label 1 only when both pass their thresholds.
First, it measures how thick the contour is in the direction orthogonal to the major axis. Let
If the eigenvalues of
Second, it measures contour convexity from perimeter ratios. If
Because irregular debris or merged objects tend to have a perimeter much longer than their convex hull, they produce smaller
The final Auto Annotation score can be written as
Auto Annotation assigns Label 1 when N/A otherwise. In other words, it keeps contours that are both laterally compact and close to convex, and it filters out broad, jagged, or debris-like shapes before manual review.
- Review results and proceed. When extraction finishes, the right panel shows all extracted cell contours across every frame. From here you can open the generated cell database or go to the cell labeling (annotation) page. If contours are not extracted well (for example, due to mismatched Canny parameters), adjust settings in the parameter tuning section and click
Re-extractto run extraction again.
This screen lists the cell databases generated by Cell Extraction. You can upload or download databases here, making it possible to separate an experiment’s database from the system as a single file.
When you click Access on a specific cell database row, you are taken to a page where you can review information for each individual cell.
The function panel offers the following view modes:
Contour: view extracted contours only.Replot: refresh the current plot from stored data.Overlay: overlay contours on the default image.Overlay Raw: overlay contours on the raw image.Overlay Fluo: overlay contours on the fluorescence image.Heatmap: visualize signal intensity as a heatmap.Map 256: render a 256-level mapped view.Map Raw: render the mapped view at native pixel resolution.Distribution: show the value distribution for the selected cell or region.
Auto-detected contours can include debris or merged cells (not single cells), so you need to remove these manually.
To label Label 1 (right panel), click a target cell (single cell) or use Shift + drag to select multiple cells, then press Apply. The right panel updates the labels in real time. You can also revert Label 1 back to N/A (backwards labeling is supported).
For a database after annotation, the left panel shows the cells labeled with the default Label 1. If debris or non-single cells are mixed in, return to the Annotation page and relabel. Once only single cells are labeled, you can run batch analytics on this population.
Batch analysis modes available in Bulk Engine include:
Cell length: measure cell length (um) from contours.Cell area: compute cell area (px^2).Normalized median: calculate normalized median intensity per cell for a selected channel.FITC aggregation ratio: compute aggregation ratio for FITC signal.Entropy: quantify intensity distribution using entropy (1 - sparsity).Heatmap: generate heatmap vectors/plots for the selected channel.Contours: visualize aligned contours and export contour coordinates.Map256: render a Map256 strip across cells.Raw data: export raw intensity values inside each contour.
JSON export is also supported, including raw intensity data.
For example, in Heatmap mode you can aggregate and visualize GFP localization for all cells of the selected label in a single plot.
The quantitative routines in PhenoPixel follow a common single-cell analysis pipeline: detect a contour from the phase-contrast image, re-parameterize the cell in its intrinsic coordinate system, and compute shape or fluorescence descriptors that are directly comparable across cells. Let
Contours are extracted from phase-contrast images with a Canny-based pipeline. The major elongation axis is estimated from the covariance of contour coordinates,
and the principal direction is the solution of
If
This removes arbitrary image rotation and makes bent or filamentous cells easier to model analytically.
Because
since
In the aligned frame, the cell centerline is approximated by a
For a curved cell, the thesis formulation defines cell length as the arc length between the two contour-centerline intersection points:
In the current backend implementation, Cell length is returned as a robust PCA major-axis extent of pixels inside the contour and converted with a fixed pixel size of
Cell area is the area enclosed by the contour,
which is stored during extraction and reported by Cell area. Raw data exports the unaggregated intensity set
for the selected channel.
For each intracellular pixel
This position is converted to arc length,
To obtain a fixed-dimensional descriptor, the arc-length interval
If no projected pixel falls into
The current implementation uses Heatmap visualizes these peak vectors either in absolute-length coordinates or in relative-position coordinates.
For any selected channel, intensities inside a cell are normalized by the cellwise maximum,
This scalar is reported by Normalized median. A population-level aggregation score can then be written as
The current FITC aggregation ratio plot uses this form with a default cutoff
For HU-GFP compaction, a 35-bin peak vector is first computed and summarized as
Using the control population, the abnormality threshold is defined by the 5th percentile,
and the HU aggregation ratio is the fraction of cells with
For PI permeability, the mean intracellular PI intensity is
with a control-derived positivity threshold
The PI-positive fraction is then the proportion of cells satisfying
- Python 3.x (Launch uses
python3.14) - Node.js with npm (frontend dev/build)
- SQLite (used by the backend; databases generated by Cell Extraction)
Backend:
python3.14 -m venv venv
source ./venv/bin/activate
cd backend
pip install -r requirements.txt
python main.pyFrontend:
cd frontend
npm install
npm run dev- Backend: http://localhost:3000
- Frontend dev server: http://localhost:3001
- API base: http://localhost:3000/api/v1
- Swagger UI (OpenAPI): http://localhost:3000/api/v1/docs
- OpenAPI JSON: http://localhost:3000/api/v1/openapi.json
- Health check: http://localhost:3000/api/v1/health
Use docker/compose.yaml to start Traefik + backend.
- Create
backend/.env(usebackend/.env.templateas a reference) - Set
SERVER_HOSTandTRAEFIK_ACME_EMAIL - Start:
cd docker
docker compose -f compose.yaml up -d --buildTraefik uses 80/443. Access the hostname set in SERVER_HOST, and the API
is exposed under /api/v1.
Backend:
- FastAPI, Uvicorn, Pydantic for the API layer
- SQLAlchemy for SQLite access
- NumPy, OpenCV, Matplotlib for image processing and plotting
Frontend:
- React + React Router for the UI
- Vite for dev/build tooling
- Chakra UI and Framer Motion for styling and motion
- Bulk Engine API: backend/app/bulk_engine/README.md
- Cell Extraction API: backend/app/cellextraction/README.md
- Frontend: frontend/README.md