Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image processing pixFRET-运行延时图像//循环的插件?_Image Processing_Macros_Imagej_Timelapse - Fatal编程技术网

Image processing pixFRET-运行延时图像//循环的插件?

Image processing pixFRET-运行延时图像//循环的插件?,image-processing,macros,imagej,timelapse,Image Processing,Macros,Imagej,Timelapse,我最近刚开始使用ImageJ(因此没有太多宏编程经验)来分析我的显微镜照片。 为了生成FRET逐像素图像,通过我使用的插件对光谱泄漏进行校正:。这个插件需要一堆3个图像才能工作:FRET、施主、受主。到目前为止,我必须自己打开每张图片,这对于大时间堆栈(>1000张图片)来说非常不方便。我正在寻找一种方法来循环插件或创建某种宏来实现这一点 我的数据结构的简短描述: workfolder\filename_t001c1(通道1图像-时间点001的施主), 文件名_t001c2(通道2图像-时间点0

我最近刚开始使用ImageJ(因此没有太多宏编程经验)来分析我的显微镜照片。 为了生成FRET逐像素图像,通过我使用的插件对光谱泄漏进行校正:。这个插件需要一堆3个图像才能工作:FRET、施主、受主。到目前为止,我必须自己打开每张图片,这对于大时间堆栈(>1000张图片)来说非常不方便。我正在寻找一种方法来循环插件或创建某种宏来实现这一点

我的数据结构的简短描述: workfolder\filename_t001c1(通道1图像-时间点001的施主), 文件名_t001c2(通道2图像-时间点001处的FRET), …t001c3(可忽略) …t001c4(通道4图像-时间点001处的接收器)

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

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

谢谢 David

以from为起点,使用宏记录器(插件>宏>录制…)获取必要的命令

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

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);
函数pixfret(路径,commonfilename){
打开(路径+公共文件名+“c2”);
打开(路径+公共文件名+“c1”);
打开(路径+commonfilename+“c4”);
运行(“要堆栈的图像”,“名称=堆栈标题=[]使用”);
运行(“PixFRET”);//请根据您的需要进行调整
}
setBatchMode(真);
n_时间点=999;
dir=“/path/to/your/images/”;
对于(i=0;i
希望对您有所帮助。

以from为起点,使用宏记录器(插件>宏>录制…)获取必要的命令

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

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);
函数pixfret(路径,commonfilename){
打开(路径+公共文件名+“c2”);
打开(路径+公共文件名+“c1”);
打开(路径+commonfilename+“c4”);
运行(“要堆栈的图像”,“名称=堆栈标题=[]使用”);
运行(“PixFRET”);//请根据您的需要进行调整
}
setBatchMode(真);
n_时间点=999;
dir=“/path/to/your/images/”;
对于(i=0;i

希望能有所帮助。

我没有找到直接包含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图像的宏,使用两个摄影机对齐
//pixFRET->需要一个单独的设置文件,将其放入与pixFRET插件相同的文件夹中
//必须在此宏中手动设置背景区域
//IJ_机器人使用光标移动-执行宏时不要移动光标+更改分辨率/系统时调整IJ_机器人坐标。
dir=getDirectory(“选择目录”);
list=getFileList(dir);
//单一对齐
运行(“图像序列…”,“打开=[dir]number=2开始=1增量=1比例=100文件=[]或=[]排序”);
重命名(File.getName(dir));
WindowTitle=getTitle()
重命名(WindowTitle+toString(“主”))
MainWindow=getTitle()
NSlices=getSliceNumber()
xValue=getWidth()/2
yValue=getHeight()/2
//设置工具(“矩形”);
make矩形(0,0,xValue,yValue);
运行(“在堆栈中对齐切片…”,“方法=5 windowsizex=“+toString(xValue*2-20)+”windowsizey=“+toString(yValue*2-20)+”x0=10 y0=10 swindow=0 ref.slice=1 show=true”);
选择窗口(“结果”);
XShift=getResult(“dX”,0);
YShift=getResult(“dY”,0);
File.makeDirectory(toString(File.getParent(dir))+toString(“\\”)+“test”+“FRET”);

对于(i=0;i我没有找到直接包含来自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图像的宏,使用两个摄影机对齐
//pixFRET->需要一个单独的设置文件,将其放入与pixFRET插件相同的文件夹中
//必须在此宏中手动设置背景区域
//IJ_机器人使用光标移动-执行宏时不要移动光标+更改分辨率/系统时调整IJ_机器人坐标。
dir=getDirectory(“选择目录”);
list=getFileList(dir);
//单一对齐
运行(“图像序列…”,“打开=[dir]number=2开始=1增量=1比例=100文件=[]或=[]排序”);
重命名(File.getName(dir));
WindowTitle=getTitle()
重命名(WindowTitle+toString(“主”))
MainWindow=getTitle()
NSlices=getSliceNumber()
xValue=getWidth()/2
yValue=getHeight()/2
//设置工具(“矩形”);
make矩形(0,0,xValue,yValue);
运行(“在堆栈中对齐切片…”,“方法=5 windowsizex=“+toString(xValue*2-20)+”windowsizey=“+toString(yValue*2-20)+”x0=10 y0=10 swindow=0 ref.slice=1 show=true”);
选择窗口(“结果”);
XShift=getResult(“dX”,0);
YShift=getResult(“dY”,0);
File.makeDirectory(toString(File.getParent(dir))+toString(“\\”)+“test”+“FRET”);

对于(i=0;iHi,感谢您的回复。您是否知道,是否可以从此宏控制pixFRET插件?我已经尝试从使用macrorecorder录制的宏运行pixFRET,但在打开pixFRET窗口时停止。例如,必须按下一个名为“Compute FRET”的按钮以及使用预定义的ROI选择要按下的3个背景按钮:重置/获取/添加。我现在将尝试使用“IJ_Ro”