1

我最近才开始使用 ImageJ(因此对宏编程没有太多经验)来分析我的显微镜图片。为了生成针对光谱流血进行校正的 FRET 逐像素图像,我使用了插件:pixFRET。这个插件需要一堆 3 个图像才能工作:FRET、Donor、Acceptor。到目前为止,我必须自己打开每张图片,这对于大时间堆栈(> 1000 张图片)来说真的很不方便。我正在寻找一种方法来循环插件或创建某种宏来执行此操作。

我的数据结构的简短描述:workfolder\filename_t001c1(通道 1 图像 - 时间点 001 的供体),filename_t001c2(通道 2 图像 - 时间点 001 的 FRET),...t001c3(可以忽略)...t001c4(通道 4 图像 - 时间点 001 处的受体)。

我必须在每个时间点创建一个 C2/C1/C4 堆栈,由 pixFRET(使用设置参数)自动分析,结果应保存在输出文件夹中。

我很感激每一个建议,因为我最大的问题是整个堆栈生成/pixFRET 分析的循环(现在只能做这个手册)。

谢谢大卫

4

2 回答 2

1

我没有找到直接包含来自 pixFRET 插件的参数和命令的方法。但是,这里我展示了一个与 IJ_Robot 一起添加这些命令的变通方法。我进一步包括了一些东西来根据时间序列的第一张图像执行相机通道的对齐。

   // Macro for creating time resolved pixFRET images with a alignment of both cameras used
// a separate setting file is required for pixFRET -> put this into the same folder as the pixFRET plugin
// the background region has to be set manually in this macro
// IJ_robot uses cursor movements - DO NOT move the cursor while excuting the macro + adjust IJ_robot coordinates when changing the resolution/system.




dir = getDirectory("Select Directory");
list = getFileList(dir);

//single alignment
 run("Image Sequence...", "open=[dir] number=2 starting=1 increment=1 scale=100 file=[] or=[] sort");
rename(File.getName(dir));
WindowTitle=getTitle()
rename(WindowTitle+toString(" Main"))
MainWindow=getTitle()
NSlices=getSliceNumber()
xValue=getWidth()/2
yValue=getHeight()/2

//setTool("rectangle");
makeRectangle(0, 0, xValue, yValue);
run("Align slices in stack...", "method=5 windowsizex="+toString(xValue*2-20)+" windowsizey="+toString(yValue*2-20)+" x0=10 y0=10 swindow=0 ref.slice=1 show=true");
selectWindow("Results");

XShift=getResult("dX", 0);
YShift=getResult("dY", 0);


File.makeDirectory(toString(File.getParent(dir))+toString("\\")+"test"+" FRET");

for(i=0;i<list.length;i+=4){
open(dir+list[i+1]);
run("Translate...", "x=XShift y=YShift interpolation=None stack");

open(dir+list[i]);


open(dir+list[i+3]);
run("Translate...", "x=XShift y=YShift interpolation=None stack");

wait(1000);
run("Images to Stack", "name=Stack title=[] use");
selectWindow("Stack");
makeRectangle(15, 147, 82, 75); //background region
run("PixFRET...");
run("IJ Robot", "order=Left_Click x_point=886 y_point=321 delay=500 keypress=[]");
run("IJ Robot", "order=Left_Click x_point=874 y_point=557 delay=500 keypress=[]");
selectWindow("NFRET (x100) of Stack");

save(toString(File.getParent(dir))+toString("\\")+"test"+" FRET"+toString(i) +".tif");

selectWindow("Stack");
close();
selectWindow("FRET of Stack");
close();

selectWindow("NFRET (x100) of Stack");
close();
run("IJ Robot", "order=Left_Click x_point=941 y_point=57 delay=300 keypress=[]");
}

感谢您的帮助 Jan。如果您能想到一种方法来直接调用这些 pixFRET 命令而不是使用 Ij_robot,请告诉我。

于 2013-06-07T19:20:35.043 回答
0

以斐济的本教程只是 ImageJ)为起点,并使用宏记录器(插件 > 宏 > 记录...)获取必要的命令。

您的宏代码可能如下所示:

function pixfret(path, commonfilename) {
    open(path + commonfilename + "c2");
    open(path + commonfilename + "c1");
    open(path + commonfilename + "c4");
    run("Images to Stack", "name=Stack title=[] use");
    run("PixFRET"); // please adjust this to your needs
}

setBatchMode(true); 
n_timepoints = 999;
dir = "/path/to/your/images/";
for (i = 0; i < n_timepoints; i++)
    pixfret(dir, "filename_t" + IJ.pad(i, 4));
setBatchMode(false);

希望有帮助。

于 2013-05-27T21:00:18.953 回答