-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectionToBand.ijm
More file actions
61 lines (51 loc) · 1.51 KB
/
SelectionToBand.ijm
File metadata and controls
61 lines (51 loc) · 1.51 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* process image before
* spot-detector/colocalization in Icy
* or Mitobo/particles2D in Fiji
* Gilles Courtand - INCIA - 2020
*
*/
// open image
ImgName=getTitle();
ImgDir=getDirectory("image");
selectWindow(ImgName);
//correct colors ch1:grey ch2:red ch3:green
Stack.setDisplayMode("color");
Stack.setChannel(1);
run("Grays");
Stack.setChannel(2);
run("Red");
Stack.setChannel(3);
run("Green");
//change color mode in "Composite" to see all the channels in same time
Stack.setDisplayMode("composite");
//select the best slice and click ok
waitForUser("select the best slice and click ok");
run("Reduce Dimensionality...", "channels keep");
ImgName2=getTitle();
//user select the cell with "segmented line" tool
setTool("polyline");
//makeLine and right click to finish
waitForUser("Trace selection and right click to finish");
//double click on the tool button to modifie the selection width
//change color mode before straigthen
Stack.setDisplayMode("color");
//run("Straighten...", "title=[P20#4-3_x63_S2-L-DMN#2-Deconvolution (adjustable)-02-2.czi] line=20 process");
run("Straighten...")
//stack to hyperstack (because Straighten convert channels to slices)
run("Make Composite", "display=Color");
//correct colors ch1:grey ch2:red ch3:green
run("Grays");
Stack.setChannel(2);
run("Red");
Stack.setChannel(3);
run("Green");
setOption("ScaleConversions", false);
run("16-bit");
print(ImgName2);
selectWindow(ImgName2);
close();
//save the file
saveAs("Tiff", "");
//colors are not preserved !!!
run("Close All");