Option "Enlarge" does not work when using "Rotate" in a "batch-run" macro

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

Option "Enlarge" does not work when using "Rotate" in a "batch-run" macro

Albert Rover
Hi,

Option "Enlarge Image to Fit Result" does not work when using the
"Rotate function" in a macro that is run in batch mode. The option is
simply ignored. Running the macro without the "-batch" option works as
expected.

Is this a bug or maybe a "design limitation"? Does anybody know a
fix/workaround?

Steps to reproduce:

1. Create the macro text.txt:

image="/tmp/test.jpg"
open(image);
run("Rotate... ", "45 grid=0 interpolation=None enlarge");
save(image);
close();

2. Run:

$ java -jar ./ij.jar -macro /tmp/test.txt -batch


Regards
Reply | Threaded
Open this post in threaded view
|

Re: Option "Enlarge" does not work when using "Rotate" in a "batch-run" macro

Michael Schmid
Hi Albert,

as far as I can say it works in ImageJ version 1.43n - maybe you have  
an old version?
   newImage("test1", "RGB White", 256, 256, 1);
   run("Rotate... ", "angle=45 grid=0 interpolation=None enlarge");
It won't enlarge the image if you have a selection different from  
'Select All'.

Michael
________________________________________________________________

On 14 Jan 2010, at 13:46, Albert Rover wrote:

> Hi,
>
> Option "Enlarge Image to Fit Result" does not work when using the
> "Rotate function" in a macro that is run in batch mode. The option is
> simply ignored. Running the macro without the "-batch" option works as
> expected.
>
> Is this a bug or maybe a "design limitation"? Does anybody know a
> fix/workaround?
>
> Steps to reproduce:
>
> 1. Create the macro text.txt:
>
> image="/tmp/test.jpg"
> open(image);
> run("Rotate... ", "45 grid=0 interpolation=None enlarge");
> save(image);
> close();
>
> 2. Run:
>
> $ java -jar ./ij.jar -macro /tmp/test.txt -batch
>
>
> Regards
Reply | Threaded
Open this post in threaded view
|

Re: Option "Enlarge" does not work when using "Rotate" in a "batch-run" macro

Albert Rover
Hi Michael,

I am using ImageJ version 1.43n. This is what Wayne said about this:

== begin quote ==

Dear Albert,

I am able to reproduce this problem, and I should be able to fix it, but
it will probably take me a few days. One work around would be to add

  setBatchMode(true);

to the beginning of the macro and to run it from within ImageJ.

Best regards,

-wayne

== end quote ==

So this is really a bug. It only occurs if you start the macro from the
command line. Maybe you started the macro from inside ImageJ and thats
why it worked for you?


Regards


On 01/15/2010 10:22 AM, Michael Schmid wrote:

> Hi Albert,
>
> as far as I can say it works in ImageJ version 1.43n - maybe you have
> an old version?
>   newImage("test1", "RGB White", 256, 256, 1);
>   run("Rotate... ", "angle=45 grid=0 interpolation=None enlarge");
> It won't enlarge the image if you have a selection different from
> 'Select All'.
>
> Michael
> ________________________________________________________________
>
> On 14 Jan 2010, at 13:46, Albert Rover wrote:
>
>> Hi,
>>
>> Option "Enlarge Image to Fit Result" does not work when using the
>> "Rotate function" in a macro that is run in batch mode. The option is
>> simply ignored. Running the macro without the "-batch" option works as
>> expected.
>>
>> Is this a bug or maybe a "design limitation"? Does anybody know a
>> fix/workaround?
>>
>> Steps to reproduce:
>>
>> 1. Create the macro text.txt:
>>
>> image="/tmp/test.jpg"
>> open(image);
>> run("Rotate... ", "45 grid=0 interpolation=None enlarge");
>> save(image);
>> close();
>>
>> 2. Run:
>>
>> $ java -jar ./ij.jar -macro /tmp/test.txt -batch
>>
>>
>> Regards
Reply | Threaded
Open this post in threaded view
|

Re: Option "Enlarge" does not work when using "Rotate" in a "batch-run" macro

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Albert Rover
On Jan 14, 2010, at 7:46 AM, Albert Rover wrote:

> Hi,
>
> Option "Enlarge Image to Fit Result" does not work when using
> the "Rotate function" in a macro that is run in batch mode. The
> option is simply ignored. Running the macro without the "-batch"
> option works as expected.
>
> Is this a bug or maybe a "design limitation"? Does anybody
> know a fix/workaround?
>
> Steps to reproduce:
>
> 1. Create the macro text.txt:
>
> image="/tmp/test.jpg"
> open(image);
> run("Rotate... ", "45 grid=0 interpolation=None enlarge");
> save(image);
> close();
>
> 2. Run:
>
> $ java -jar ./ij.jar -macro /tmp/test.txt -batch

The 1.43o daily build fixes a bug that caused commands implemented using macros to fail if the "ImageJ" window was not open, which is the case when using the "-batch" option to run a macro from the command line. The Rotate command used in this "-batch" macro failed because it uses the Edit>Selection>Rotate command, which is implemented using the macro at

   http://rsbweb.nih.gov/ij/source/macros/RotateSelection.txt

-wayne