设置imagej宏到批处理过程实验室图像
我目前正在尝试使用imagej/fiji立即处理大量实验室图像,但是我很难处理图像。每当将文件拔起时,都会有三个图像分为频道并在单独的窗口中打开。在处理过程中,选择了每个窗口,需要以不同的方式处理。我目前正在尝试根据特定参数而不是窗口的确切名称选择每个不同的窗口。每个窗口将以“ C = 0”,“ C = 1”或“ C = 2”结尾。我希望代码选择包含字符串“ C = 0”,“ C = 1”或“ C = 2”字符串的窗口,但我似乎无法使其工作。截至目前,它仅在第一个文件中运行,而其余则不在。我正在运行的当前代码看起来像这样。
open("/Users/name/Desktop/name of file");
selectWindow("name of window - C=1");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 10);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...");
close();
run("Close");
selectWindow("name of window - C=0");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 20);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...", "size=20-700 show=Overlay display summarize add composite");
run("Analyze Particles...");
roiManager("Show None");
roiManager("Show All");
run("Close");
close();
run("Close");
selectWindow("name of window - C=2");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 4);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...");
saveAs("Results", "/Users/name/Desktop/results/Summary.csv");
任何帮助都将不胜感激。谢谢。
I'm currently trying to batch process a lot of lab images at once using ImageJ/Fiji but I'm having a hard time making it process the images. Whenever a file is pulled up, there are three images which are split into channels and open in separate windows . During the processing, each window is selected and needs to be processed differently. I am currently trying to figure out how to make the program select each different window based on a specific parameter rather than the exact name of the window. Each of the windows will end in "C=0", "C=1", or "C=2". I want the code to select the windows that contain the string "C=0", "C=1", or "C=2" in them but I can't seem to get it to work. As of now, it only runs through the first file but not the rest. The current code I'm running looks like this.
open("/Users/name/Desktop/name of file");
selectWindow("name of window - C=1");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 10);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...");
close();
run("Close");
selectWindow("name of window - C=0");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 20);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...", "size=20-700 show=Overlay display summarize add composite");
run("Analyze Particles...");
roiManager("Show None");
roiManager("Show All");
run("Close");
close();
run("Close");
selectWindow("name of window - C=2");
setOption("ScaleConversions", true);
run("8-bit");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 4);
run("Convert to Mask");
run("Convert to Mask");
run("Analyze Particles...");
saveAs("Results", "/Users/name/Desktop/results/Summary.csv");
Any and all help would be super appreciated. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要处理多个文件而不手动打开每个文件,则将所有文件放在同一文件夹中,然后编写一个for loop是很方便的。
这是ImageJ宏语言中的一个示例,基于您提供的代码:
If you want to process several files without manually opening each, it's convenient to put all files in the same folder, and then write a for loop.
Here's an example in the ImageJ macro language, based on the code you provided: