Login  Register

Re: IJ and macros/Java code

Posted by Rasband, Wayne (NIH/NIMH) [E] on Feb 25, 2011; 4:54pm
URL: http://imagej.273.s1.nabble.com/IJ-and-macros-Java-code-tp3685554p3685555.html

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