Re: Creation of a 3D ROIs
Posted by Galathorn on Mar 14, 2014; 8:46am
URL: http://imagej.273.s1.nabble.com/Creation-of-a-3D-ROIs-tp5006882p5006910.html
Thanks a lot for your rapid answer. When I run your macro an error message appears: "No overlay in line 14. Overlay.<add Selection>"
As I never use Overlays before, I don't know what it means and what I have to change in the macro.
Moreover, how can I insert my macro in your macro to get a grid with multiple rectangles and not only one in the middle of the image?
I tried this but it seems that it doesn't work...
run("T1 Head (2.4M, 16-bits)");
width = getWidth;
height = getHeight;
depth = nSlices;
x = 50;
y = 50;
z0 = depth/4;
d = depth/2;
numRow= 4;
numCol=4;
for(i = 0; i< numRow; i++)
{
for(j=0;j<numCol;j++)
{
xOffset = j * (width);
yOffset = i * (height);
for (z=0; z<depth; z++) {
if (z>=z0 && z<=z0+d) {
makeRectangle(x+ xOffset,y+yOffset,width,height);
Overlay.addSelection;
Overlay.setPosition(z+1);
}
}
}
}
run("Clear Results");
setOption("Stack Position");
for (i=0; i<Overlay.size; i++) {
Overlay.activateSelection(i);
run("Measure");
}
run("Select None");
Thanks.
Thibaut