-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcellpose_script.groovy
39 lines (33 loc) · 1.05 KB
/
cellpose_script.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#@ImagePlus imp
#@File(style="directory" , label="Select conda environment") conda_env_path
#@CommandService command
#@Output labels
#@RoiManager rm
#@ResultsTable rt
rt.reset()
rm.reset()
IJ.runMacro("close('\\\\Others');")
// cellpose parameters
def cp = new Cellpose();
cp.env_path = conda_env_path
// Or comment the line avove and set the path manually
// to locate your conda env from a terminal type "conda env list", it will return the path you can paste below
//cp.conda_env_path = new File ( "D:/conda/conda_envs/cellpose/" ) ;
cp.imp = imp;
cp.diameter = 50;
cp.model = "cyto3";
cp.ch1 = 1 ;
cp.ch2 = 2 ;
//cp.additional_flags= "--use_gpu, --do_3D, --anisotropy, 4 , --restore_type , denoise_cyto3";
cp.additional_flags= "--use_gpu, --restore_type , denoise_cyto3";
// cellpose run
cp.run();
// get the output labels image
cp_imp = cp.cellpose_imp ;
cp_imp.show()
IJ.run(cp_imp, "Label image to ROIs", "");
IJ.run(cp_imp, "glasbey_inverted", "");
cp_imp.setDisplayRange(0, 12);
return
import ch.epfl.biop.wrappers.cellpose.ij2commands.Cellpose
import ij.IJ;