Posted by
Jerome Mutterer-3 on
May 09, 2014; 8:30am
URL: http://imagej.273.s1.nabble.com/Rotate-grid-tp5007581p5007650.html
Dear Chris,
the following macro tool allows you to paint an overlay grid.
The angle is adjusted as you're dragging the mouse.
The grid step is the tool's option.
Jerome
// a tool that overlays a grid on the image with adjustable angle and step.
var step =50;
macro "Grid Tool - C00cT1f1aG" {
max = maxOf(getWidth,getHeight);
getCursorLoc(x0, y0, z, flags);
while (flags&16!=0) {
getCursorLoc(x, y, z, flags);
a = atan2(x-x0, y-y0);
showStatus("step:"+step+" px; angle:"+d2s(180*a/PI,2)+" degrees");
Overlay.remove;
for (i=0;i<max/step;i++) {
Overlay.moveTo(x0+i*step*sin(a), y0+i*step*cos(a));
Overlay.lineTo(x0+ max*cos(a)+i*step*sin(a), y0-max*sin(a)+i*step*cos(a));
Overlay.moveTo(x0+i*step*cos(a), y0-i*step*sin(a));
Overlay.lineTo(x0+ max*sin(a)+i*step*cos(a), y0+ max*cos(a)-i*step*sin(a));
}
Overlay.show;
wait(10);
}
}
macro "Grid Tool Options" {
step = getNumber("Step (in pixels):", step);
}
On 6 May 2014 10:05, Straatman, Kees (Dr.) <
[hidden email]> wrote:
>
> Dear Chris,
>
> Try Image > Selection > Rotate
>
> Best wishes
>
> Kees
>
>
> Dr Ir K.R. Straatman
> Senior Experimental Officer
> Centre for Core Biotechnology Services
> University of Leicester
>
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
christopher of the family hunt coulon
> Sent: 05 May 2014 23:09
> To:
[hidden email]
> Subject: Rotate grid?
>
> Is there a way to rotate a nondestructive grid by an arbitrary angle? I
couldn't find any way to do this via a web search and would like to avoid
working this out if it has already been done.
>
> Thanks in advance,
>
> Chris Coulon
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
T 0367155339
www.ibmp.cnrs.fr
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html