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
Java 如何使用ImageJ/FIJI裁剪网格中每个元素的图像_Java_Image Processing_Tiff_Imagej_Imagej Macro - Fatal编程技术网

Java 如何使用ImageJ/FIJI裁剪网格中每个元素的图像

Java 如何使用ImageJ/FIJI裁剪网格中每个元素的图像,java,image-processing,tiff,imagej,imagej-macro,Java,Image Processing,Tiff,Imagej,Imagej Macro,我有12张照片。我正在处理。然后,我为所有图像统一制作了大小为2923779的网格(使用分析->工具->网格)(即每点面积_u像素^2)。 看起来是这样的: 我想做的是根据网格的每个元素裁剪上面的每个图像,并将每个裁剪保存为一个文件。 我该怎么做 可以下载上面的一个文件(160MB)。您必须了解grid.java的代码才能执行所需操作。 在宏中: dir = getDirectory("the directory with all your files"); files = getFileLi

我有12张照片。我正在处理。然后,我为所有图像统一制作了大小为2923779的网格(使用分析->工具->网格)(即每点面积_u像素^2)。 看起来是这样的:

我想做的是根据网格的每个元素裁剪上面的每个图像,并将每个裁剪保存为一个文件。 我该怎么做


可以下载上面的一个文件(160MB)。

您必须了解grid.java的代码才能执行所需操作。 在宏中:

dir = getDirectory("the directory with all your files");
files = getFileList(dir);
out = getDirectory ("Select output directory");
number = lengthOf(files); // normally 12 in your case
i=0;
while (i < number) {
    // write a function to extract the x and y coordinates, the width and the height of each rectangle of your grid. For that, you have to understand the code of grid.java to understand how you can have the coordinates of each rectangle.
    listcoordinates = yourfunction(files[i], 2923779);// return a vector of (x0, y0, width0, height0, x1, y1, etc...) => x= x coordinate on the top left of the square, y= y coordinate on the top left of the square
    for(j=0; j<lengthOf(listcoordinates); j+4) //foreach coordinate that you extract
     {
        makeRectangle(listcoordinates[j], listcoordinates[j+1], listcoordinates[j+2], listcoordinates[j+3]);
        run("Duplicate...", "title=blabla"+ i + j +".tif");
        saveAs("Tiff", out+ "blabla" + i + j + ".tif");
     }
}
dir=getDirectory(“包含所有文件的目录”);
files=getFileList(dir);
out=getDirectory(“选择输出目录”);
数字=长度(文件);//你的情况通常是12岁
i=0;
while(ix=x位于正方形左上角的坐标,y=y位于正方形左上角的坐标
对于(j=0;j