Batch mode: Animation Options speed

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

Batch mode: Animation Options speed

Toby Starborg
Dear ImageJ users,  I'm hoping that you can help me with a small problem
that Ii have.  I have written a rather crude macro to generate little
animated gifs for all my folders containing dm4 images.  The macro works
quite well, but in batch mode the animation speed is not set.


Specifically I use the option setBatchMode(true);   at the start of the
macro and the command that now doesn't work is:

run("Animation Options...", "speed="+speed);

where 'speed' is calculated as 5/number_of_frames (this is number is
input into the function).


When I test it without batchmode it works fine, but with batchmode on
all of the animation speeds default to the last defined speed.


I was wondering if this is meant to happen, or if I have missed an
option that would help me.


Thanks in advance.


TobyS

--
Dr Tobias Starborg
Senior Experimental Officer: 3DEM
Wellcome Centre for Cell Matrix Research
Michael Smith Building
Manchester
M13 9PT
Tel: +44(0)1612755170
http://www.polara.manchester.ac.uk

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Batch mode: Animation Options speed

Michael Schmid
Hi Toby,

Which animated gif export do you use?
The external plugin of ImageJ1 or the built-in File>Save As>Animated GIF
of ImageJ2/Fiji?

It might be also helpful to have a simple test macro that shows the
problem (e.g. using one of the stacks from the Open Samples menu), in
the spirit of a "Minimal, Complete and Verifiable Example".
   https://imagej.net/Bug_reporting_best_practices#Be_concise

Best,

Michael
________________________________________________________________


On 12/02/2018 15:34, Toby Starborg wrote:

> Dear ImageJ users,  I'm hoping that you can help me with a small problem
> that Ii have.  I have written a rather crude macro to generate little
> animated gifs for all my folders containing dm4 images.  The macro works
> quite well, but in batch mode the animation speed is not set.
>
>
> Specifically I use the option setBatchMode(true);   at the start of the
> macro and the command that now doesn't work is:
>
> run("Animation Options...", "speed="+speed);
>
> where 'speed' is calculated as 5/number_of_frames (this is number is
> input into the function).
>
>
> When I test it without batchmode it works fine, but with batchmode on
> all of the animation speeds default to the last defined speed.
>
>
> I was wondering if this is meant to happen, or if I have missed an
> option that would help me.
>
>
> Thanks in advance.
>
>
> TobyS
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Batch mode: Animation Options speed

Wayne Rasband-2
In reply to this post by Toby Starborg
> On Feb 12, 2018, at 9:34 AM, Toby Starborg <[hidden email]> wrote:
>
> Dear ImageJ users,  I'm hoping that you can help me with a small problem that Ii have.  I have written a rather crude macro to generate little animated gifs for all my folders containing dm4 images.  The macro works quite well, but in batch mode the animation speed is not set.
>
> Specifically I use the option setBatchMode(true);   at the start of the macro and the command that now doesn't work is:
>
> run("Animation Options...", "speed="+speed);
>
> where 'speed' is calculated as 5/number_of_frames (this is number is input into the function).
>
>
> When I test it without batchmode it works fine, but with batchmode on all of the animation speeds default to the last defined speed.

This bug is fixed in the latest ImageJ daily build (1.51u53). Here is a small macro that reproduces the problem:

  setBatchMode(true);
  run("T1 Head Renderings (736K)");
  speed = 30; //fps
  run("Animation Options...", "speed="+speed);
  saveAs("Gif", getDirectory(“home”)+“test.gif”);

-wayne;

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html