Skip to content

Instantly share code, notes, and snippets.

@romainGuiet
Created October 21, 2025 07:24
Show Gist options
  • Select an option

  • Save romainGuiet/bc3ffbc951e8e8b0733dfb66327e5879 to your computer and use it in GitHub Desktop.

Select an option

Save romainGuiet/bc3ffbc951e8e8b0733dfb66327e5879 to your computer and use it in GitHub Desktop.
//PARAMETERS
nuclei_ch = 3
measure_ch = 1
conda_env_path = "D:/conda/conda-envs/cellpose-3111" // replace with the path to your cellpose environment
image_title = getTitle();
// do some cleaning
roiManager("reset");
run("Clear Results");
close("\\Others");
// duplicate your nuclei channel
run("Duplicate...", "duplicate title=nuclei channels="+nuclei_ch);
// run cellpose from Fiji (PTBIOP update site , github : https://github.com/BIOP/ijl-utilities-wrappers
run("Cellpose ..." ,"imp=nuclei conda_env_path="+conda_env_path+" env_type=conda diameter=30 model=cyto3 model_path= ch1=1 ch2=1 additional_flags=--use_gpu" );
// convert label image to ROIs (also from (PTBIOP update site , https://github.com/BIOP/ijp-LaRoMe )
run("Label image to ROIs", "");
// Measure
selectImage(image_title);
Stack.setChannel(measure_ch);
roiManager("Show All");
roiManager("Measure");
// prepapre output image
run("Flatten");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment