-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmergeImages.ijm
37 lines (29 loc) · 994 Bytes
/
mergeImages.ijm
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
// merge all images into one file
// Close all open tif's
close("*.tif");
experimentName = "N2_dpy23_wdr52_mdh1_002";
setBatchMode(true);
// Define Output Folder
// output = getDirectory("Select a Directory for output");
// Define Output Folder
output = "/home/milkyklim/Documents/data/2017-05-28_smFISH-rex1-deletion/" + experimentName + "/validation/";
// merge all images
filenames = getFileList(output);
Array.sort(filenames);
for (i = 0; i < filenames.length; i++){
filename = filenames[i];
// wqork only with tif files in the folder
if (endsWith(filename, ".tif") && !startsWith(filename, "all")){
// show which file we are processing
print(filename);
// progress bar
showProgress(i + 1, filenames.length);
file = output + filename;
// open initial image
open(file);
title = filename;
}
}
run("Images to Stack", "name=[" + "all_" + experimentName + "] title=[" + experimentName + "] use");
saveAs("Tiff", output + "all_" + experimentName);
print("DOGE!");