A Fiji macro to perform Cellpose segmentation and subsequent BIOP JACoP colocalization analysis on every cell for all images in a folder.
This macro was published with: Cholesterol biosynthesis as a drug-induced vulnerability in diffuse large B cell lymphoma insensitive to EZH2 inhibition, Neoplasia 70 (2025), by Rachele Niccolai et al.
Download Segment_cells_and_perform_JACoP.ijm. If placed in Fiji.app\plugins\Macros the macro appears in the Fiji menu bar under Plugins -> Macros. Otherwise, drag & drop onto the Fiji window and click 'Run' in the Script Editor.
Requires the following Fiji Update Sites:
- CLIJ
- CLIJ2
- PT-BIOP Cellpose is executed using the BIOP Cellpose wrapper. A working Cellpose environment (venv or conda) is required. Run the wrapper at least once to set the cellpose environment path and type.
Input: a folder containing multichannel 2D images. Multiseries microscopy format files (.lif, .czi etc.) are also supported. Output: for each image:
- labelmap images containing Cellpose segmentations
- Analyzed images with two extra channels containing the used masks (thresholds) for colocalization. The analysis parameters are added to the "Info" image property [Image>Show Info] as part of the TIFF header).
tsvfiles with colocalization results. These can be directly loaded in Excel/R/Prism for further processing.
Upon running you will see a dialog with script parameters:
Most parameters are self-explaining. A few others are discussed here:
-
Nuclei channel (-1 if not used): Only used by Cellpose for segmentation. This channel is not required.
-
Cytoplasm channel: Used by Cellpose for segmentation.
-
Image XY binning before analysis [1-n]: n x n pixel binning to reduce the size of the image.
-
Gaussian blur radius (sigma) before JACoP (pixels): Filter the image to reduce noise.
-
flow threshold [0.0 - 1.0], default 0.4: Cellpose segmentation parameter; incresae to accept more cells.
-
probability threshold [-6.0 - 6.0], default 0.0: Cellpose segmentation parameter; decrease to increase segmented cell size (and accept more cells).
-
Load segmentation label images from disk instead of Cellpose?: Load segmented labels from disk instead of running Cellpose segmentation. Label images should have the same basename as the input images, complemented with '_labelmap.tif'.
-
Threshold method: Automatic threshold method for channel A. Select 'Use manual threshold below' to use a fixed manual threshold for every cell.
Input image:
Output label image:
Output image with thresholds indicated (as two extra channels, with the same LUT as the two input channels):
Output results:
For every image a separate results file is saved. Use the macro Append_result_files.ijm to merge all .tsv files in a folder. It will create a file called Results_all_files.tsv.



