当前位置: 首页 > 知识库问答 >
问题:

运行延时图像//循环的插件?

景鸿才
2023-03-14

我最近才开始使用ImageJ(因此没有太多宏编程经验)来分析我的显微镜图片。为了生成FRET像素逐像素图像,这些图像被校正为光谱渗漏通过我使用的插件:像素。此插件需要3个图像的堆栈才能工作:FRET,捐助者,接受者。到目前为止,我必须自己打开每一张图片,这对于大时间堆栈来说真的很不方便(

我的数据结构的简短描述:工作文件夹\filename_t001c1(通道1图像-时间点001的捐助者),filename_t001c2(通道2图像-时间点001的FRET),... t001c3(可以忽略)... t001c4(通道4图像-时间点001的接受者)...

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

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

谢了David

共有2个答案

公孙宸
2023-03-14

以斐济的本教程(只是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);

希望有帮助。

储峻
2023-03-14

我没有找到直接包含来自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=[]");
}

谢谢你的帮助,简。如果你能想出一种直接调用这些pixFRET命令而不是使用Ij_机器人的方法,请告诉我。

 类似资料:
  • 我在试着理解为什么一些简单的环路会以这样的速度运行 第一种情况: 根据IACA,吞吐量是1个周期,瓶颈是端口1,05。我不明白为什么它是1 cylce。毕竟我们有两个循环承载的依赖关系: 而且这种Latency是循环进行的,所以它应该会减慢我们的迭代。 第二种情况: 我更不明白为什么吞吐量是1.65。

  • 问题是:PageSpeedInsights说图像没有被延迟加载,留档说img标签应该被“data-page espeed-laily-src”属性替换(它没有这样做)。 pagespeed.conf: 超文本标记语言: 它正在转换png图像,我看到了“X-Mod-Pagespeed”标题,所以我确信模块在那里。 /pagespeed_admin显示“Lazyload Images”过滤器已启用。o

  • 问题内容: 我有一个非循环的gif,可以用作两个JLabel的ImageIcon,但不能同时使用。 我的问题是,当我将第二个JLabel的图标设置为gif时,该动画已经播放过,因此仅显示了它的最后一帧。 当gif设置为第二个JLabel时,您知道一种获取动画的方法吗? 问题答案: 在新创建的图标上,尝试使用:

  • 基本上,我正在Python中的一个订阅计数器应用程序的“草案”上工作。我使用YouTube数据API从YouTube获取数据,然后循环这段代码以更新订阅者计数。但是由于我的GUI代码在循环之后,它永远不会开始,因为循环是无限的,永远不会结束。我尝试将GUI部分放在代码之前,以获得子计数,但没有定义任何变量,因此返回错误。所以基本上,我的问题是如何重新组织它,使其工作,子计数在GUI中更新。我听说过

  • 我需要12次外循环,每个外循环1次内循环 例如: 等 但现在我的内循环在第一次迭代的外循环上运行。 请帮助我如何使用for循环执行此操作。

  • 我是分析时间的新手complexity.some有人能帮我解决下面算法的时间复杂度吗? 外部循环将运行日志(n)次。内部循环将运行多少次。我们如何用“n”来计算内环的频率,因为它取决于变量“i”。 有人能帮忙找出上面代码的时间复杂度吗。