IJ and macros/Java code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

IJ and macros/Java code

Sebastian B=?UTF-8?Q?=C3=B6ckmann?=
Hello,

I've the following problem:
If I use the code

IJ.run(imp, "Rotate... ", "angle=45 grid=3 interpolation=Bilinear enlarge");

... in my Java application, then the program does not show the rotated image and the program seems to be crashed somehow. So I tried to rebuild the code:

ip.setInterpolationMethod(ip.BILINEAR);
ip.rotate(45);

But how do I rebuild the "enlarge" parameter to show the image properly?

Best regards
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: IJ and macros/Java code

Christian Moll
Hello Sebastian,

try to use Rotator instead of ip.rotate().

http://rsbweb.nih.gov/ij/developer/source/ij/plugin/filter/Rotator.java.html

Best Christian

-----------------------------------------------------------------
Christian Moll  -  Ingenieur de Recherche
[hidden email]
-----------------------------------------------------------------
CRP Henri Tudor  -  http://santec.tudor.lu
2A, rue Kalchesbrück
L-1852 Luxembourg
-----------------------------------------------------------------



From:   Sebastian Böckmann <[hidden email]>
To:     <[hidden email]>
Date:   02/25/2011 10:21 AM
Subject:        IJ and macros/Java code
Sent by:        ImageJ Interest Group <[hidden email]>



Hello,

I've the following problem:
If I use the code

IJ.run(imp, "Rotate... ", "angle=45 grid=3 interpolation=Bilinear
enlarge");

... in my Java application, then the program does not show the rotated
image and the program seems to be crashed somehow. So I tried to rebuild
the code:

ip.setInterpolationMethod(ip.BILINEAR);
ip.rotate(45);

But how do I rebuild the "enlarge" parameter to show the image properly?

Best regards
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: IJ and macros/Java code

Sebastian B=?UTF-8?Q?=C3=B6ckmann?=
In reply to this post by Sebastian B=?UTF-8?Q?=C3=B6ckmann?=
Thanks!. I'll try it.

Best regards
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: IJ and macros/Java code

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Sebastian B=?UTF-8?Q?=C3=B6ckmann?=
On Feb 25, 2011, at 4:18 AM, Sebastian Böckmann wrote:

> Hello,
>
> I've the following problem:
> If I use the code
>
> IJ.run(imp, "Rotate... ", "angle=45 grid=3 interpolation=Bilinear enlarge");
>
> ... in my Java application, then the program does not show the rotated image and the program seems to be crashed somehow. So I tried to rebuild the code:
>
> ip.setInterpolationMethod(ip.BILINEAR);
> ip.rotate(45);
>
> But how do I rebuild the "enlarge" parameter to show the image properly?

You have to 'show' the image. Here is an example script, created using the command recorder, that rotates the blobs sample image 45 degrees:

  imp = IJ.openImage("http://imagej.nih.gov/ij/images/blobs.gif");
  IJ.run(imp, "Rotate... ", "angle=45 interpolation=Bilinear enlarge");
  imp.show();

-wayne