有没有办法并排“堆叠组合”3个堆叠。
图像>堆栈>工具>组合
支持并排组合 2 个堆栈。解决这个问题的两种方法:
- 合并前 2 个,然后将合并后的图像合并到第三个堆栈
- 创建一个执行上述操作的宏
run("Combine...", "stack1=STAC1_NAME stack2=STACK2_NAME");
run("Combine...", "stack1=[Combined Stacks] stack2=STACK3_NAME");
还有另一种方法可以做到这一点,因为例如并排组合 20 个堆栈。
添加了代码片段/
//Specify Folders here//
output = "PATH";
combined = "PATH";
original= "PATH";
//Batch Mode for ImageJ
setBatchMode(true);
list = getFileList(input);
for (i = 0; i < list.length; i++) {
combine(original, output, combined, list[i]);
}
setBatchMode(false);
function combine(original, output, combined, filename) {
//Open Outline & Overlay for Combine Stack//
name_outline = filename + "_outline.png";
name_overlay = filename + "_overlay.png";
name_ellipse = filename + "_ellipse.png";
name_original = replace(filename, "_watershed.tif", ".tif");
open(original + name_original);
run("RGB Color");
open(output + name_overlay);
run("RGB Color");
open(output + name_outline);
run("RGB Color");
open(output + name_ellipse);
run("RGB Color");
run("Combine...", "stack1=filename stack2=name_overlay");
rename("combinedstack01");
run("Combine...", "stack1=name_outline stack2=name_ellipse");
rename("combinedstack02");
run("Combine...", "stack1=combinedstack01 stack2=combinedstack02");
saveAs("PNG", combined + filename + "_comb.png");
run("Close All");
}