Login  Register

Re: Macro to analyze periphery rectangular areas of rotated rectangles

Posted by Volker Baecker on Aug 07, 2008; 7:49am
URL: http://imagej.273.s1.nabble.com/Macro-to-analyze-periphery-rectangular-areas-of-rotated-rectangles-tp3695435p3695438.html

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Roger,
you can use string concatenation (the number is converted automatically
to a string).

angle = 12;
run("Rotate...", "angle=" + angle);

Volker

Roger Chang a écrit :
| Hi Volker,
| I tried to use the run("Rotate...", "angle=33"); function, but I want the
| image selection to rotate a value incorporated in a variable. Do you know
| if instead it can rotate a value designated by such a variable?
|
| Thanks!
| -Roger Chang
| Washington University in St. Louis BME Department: Efimov Lab
| Hello Roger,
| there is a rotate command for rois in ImageJ. You can find it in the
| menu Edit>Selection>Rotate... The macro code to run it is
| run("Rotate...", "angle=33");
|
| This command calls a macro RotateSelection.txt that you can find in the
| ij.jar.
|
| I'm using ImageJ 1.41b but according to
| http://rsbweb.nih.gov/ij/docs/all-notes.html
| the rotate command for selections was introduced in 1.35b
|
| Best regards,
| Volker Baecker
|
| Roger Chang a écrit :
| | Dear ImageJ Listserv members,
| | I am in the middle of writing an ImageJ macro to analyze the area in
| rotated
| | image selection rectangles' periphery rectangles. What I mean by
| periphery
| | rectangles is taking each of the four sides of the original rotated
| | rectangle selection and creating four smaller, periphery rectangles that
| | "surround" the original rotated rectangle on all four sides. However,
| these
| | periphery rectangles do not extend out, but extend into the original
| rotated
| | rectangle selection area.
| |
| | I am having a lot of trouble calculating and defining these periphery
| | rectangles with trignometric calculations. If the angle is too close to
| 90
| | deg. or 0 deg., the periphery rectangles of the longer sides become
| shorter
| | or longer than the original rectangles.
| |
| | Do any of you have any other suggestions of another approach to define
| these
| | four rotated, periphery rectangles that surround the original rotated
| | rectangle? Unfortunately, I have not found any mention of a rotate
| function
| | for image selections in the ImageJ Listserv or in the macro function
| list;
| | although there are many rotate functions for an entire image.
| |
| | If any of my explanation was not clear, please feel free to reply for a
| | clarification.
| |
| | Yours truly,
| | Roger Chang
| | Washington University in St. Louis BME Department: Efimov Lab
| |
|>
- --
passerelle antivirus du campus CNRS de Montpellier
- --
|>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFImqkTxZKX7A/4oMERAinDAJ0ZFM0q3iu55gdYu3bC6Zm1qzAhDgCg3Ao5
CM/HsxATG7IAuoNEhbTT42Y=
=s+OB
-----END PGP SIGNATURE-----

--
passerelle antivirus du campus CNRS de Montpellier
--