ImageJ/Fiji-使用宏保存CSV

发布于 2025-01-19 02:44:57 字数 1191 浏览 0 评论 0原文

我不是编码器,而是试图将雷暴的批处理过程变成一个自动化的过程,其中我有一个单个输入文件夹和一个单个输出文件夹。

input_directory = newArray("C:\\Users\\me\\Desktop\\Images");
output_directory = ("C:\\Users\\me\\Desktop\\Results");

for(i = 0; i < input_directory.length; i++) {
    open(input_directory[i]);
    originalName = getTitle();
    originalNameWithoutExt = replace( originalName , ".tif" , "" );
    fileName = originalNameWithoutExt;
    run("Run analysis", "filter=[Wavelet filter (B-Spline)] scale=2.0 order=3 detector "+
        "detector=[Local maximum] connectivity=8-neighbourhood threshold=std(Wave.F1) "+
        "estimator=[PSF: Integrated Gaussian] sigma=1.6 method=[Weighted Least squares] fitradius=3 mfaenabled=false "+
        "renderer=[Averaged shifted histograms] magnification=5.0 colorizez=true shifts=2 "+
        "repaint=50 threed=false");
    saveAs(fileName+"_Results", output_directory);
}

这可能看起来像是一团糟,但是原始批处理文件使用数组,我无法弄清楚那是什么。将其刹车,所以我将其放入。

使用运行(“导出结果”)有效,但我需要手动选择一个位置和文件名。我尝试设置此文件名称并将其重命名为通用图像名称,以便可以使用该名称保存CSV。

指出我为什么白痴的任何帮助?我还希望一次只打开一个文件(这会打开所有文件),并在分析完成后将其关闭。但是,如果我只能自动保存该死的CSV,我将在不同的一天下做这件事。

在大多数情况下,我将代码弄坏了很多次,但它处于这样的工作状态。

感谢所有的帮助。谢谢你!

I am not a coder but trying to turn ThunderSTORM's batch process into an automated one where I have a single input folder and a single output folder.

input_directory = newArray("C:\\Users\\me\\Desktop\\Images");
output_directory = ("C:\\Users\\me\\Desktop\\Results");

for(i = 0; i < input_directory.length; i++) {
    open(input_directory[i]);
    originalName = getTitle();
    originalNameWithoutExt = replace( originalName , ".tif" , "" );
    fileName = originalNameWithoutExt;
    run("Run analysis", "filter=[Wavelet filter (B-Spline)] scale=2.0 order=3 detector "+
        "detector=[Local maximum] connectivity=8-neighbourhood threshold=std(Wave.F1) "+
        "estimator=[PSF: Integrated Gaussian] sigma=1.6 method=[Weighted Least squares] fitradius=3 mfaenabled=false "+
        "renderer=[Averaged shifted histograms] magnification=5.0 colorizez=true shifts=2 "+
        "repaint=50 threed=false");
    saveAs(fileName+"_Results", output_directory);
}

This probably looks like a huge mess but the original batch file used arrays and I can't figure out what that is. Taking it out brakes it so I left it in. The main issues I have revolve around the saveAs part not working.

Using run("Export Results") works but I need to manually pick a location and file name. I tried to set this up to take the file name and rename it to the generic image name so it can save a CSV using that name.

Any help pointing out why I'm a moron? I would also love to only open one file at a time (this opens them all) and close it when the analysis is complete. But I will settle for that happening on a different day if I can just manage to save the damn CSV automatically.

For the most part, I broke the code a whole bunch of times but it's in a working condition like this.

I appreciate any and all help. Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文