-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_macro.java
More file actions
43 lines (38 loc) · 1.48 KB
/
sample_macro.java
File metadata and controls
43 lines (38 loc) · 1.48 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
// Fiji Macro for co-registration
// ****************** CHANGE THIS SECTION ****************************
//Specify ouput directory here (e.g. /User/yourname/data/registration)
//out_dir = "/some/path"
out_dir = "/Users/thomaschristinck/Desktop/Ruthazer/deformations"
//Specify number of cleaned images to be registered
nb_images = 12
// *******************************************************************
for (i = 0; i < nb_images; i++) {
moving = i + 1;
target = i;
selectWindow("cleaned_image_" + moving + ".tiff");
//run("Brightness/Contrast...");
setMinAndMax(0, 65535);
run("Rigid Registration", "initialtransform=[] n=1 tolerance=0.1 level=5 stoplevel=1 materialcenterandbbox=[] showtransformed template=cleaned_image_" + target + ".tiff measure=Euclidean");
//run("Brightness/Contrast...");
setMinAndMax(0, 65535);
saveAs("Tiff", out_dir + "/transformed" + moving + ".tif");
run("Merge Channels...", "c1=cleaned_image_" + target + ".tiff c2=transformed" + moving + ".tif create keep");
run("RGB Color", "slices");
saveAs("Tiff", out_dir + "/superimposed_" + target + "_" + moving + ".tif");
close();
close("transform*");
if (i > 0){
close("cleaned_image_" + i - 1 + ".tiff");
}
close("Composite*");
close("Matrix*");
}
//selectWindow("superimposed_0_1.tif");
//selectWindow("superimposed_3_4.tif");
//run("Brightness/Contrast...");
//setMinAndMax(0, 50);
//setMinAndMax(0, 50);
//setMinAndMax(0, 50);
//run("Brightness/Contrast...");
//setMinAndMax(0, 50);
//run("Apply LUT", "stack");