// usage : ImageJ -macro bb.txt directory {start increment} {x y width height} arg=split(getArgument," ,"); if (arg.length==1 || arg.length==3 || arg.length==5 || arg.length==7) { if (arg.length==3 || arg.length==7) s_i=" starting="+arg[1]+" increment="+arg[2]; else s_i=""; run("Image Sequence...","open=["+arg[0]+"]"+s_i+" sort use"); if (arg.length==5 || arg.length==7) { x=0+arg[arg.length-4]; w=0+arg[arg.length-2]; y=0+arg[arg.length-3]; h=0+arg[arg.length-1]; if (x>=0 && w>=0 && x+w<=getWidth && y>=0 && h>=0 && y+h<=getHeight) makeRectangle(x,y,w,h); } setTool("rectangle"); while (true) { setOption("DisablePopupMenu",true); f=4; while (f&4!=0) getCursorLoc(x,y,z,f); while (f&4==0) getCursorLoc(x,y,z,f); setOption("DisablePopupMenu",false); getSelectionBounds(x,y,w,h); if (getBoolean("selected bounding box :\n"+ "x = "+x+" - "+(x+w-1)+" / w = "+w+"\n"+ "y = "+y+" - "+(y+h-1)+" / h = "+h+"\n \n"+ "record on Log window ?")) print(x,x+w-1,w,y,y+h-1,h); } }