Multiple image processing optimization

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

Multiple image processing optimization

jzapata
I've been writing a macro to apply rotation, scaling and offset corrections for set of 700+ images.
The way it's coded the macro cycles through the files in the folder one at a time. The process is very slow.

What is the best way to optimize this?

I've considered opening the images as a stack first and then applying the parameters, but in practice this gives me "out of memory" errors.

Is there a way of modifying the images without opening them?



One less pressing concern is that from time to time while processing the images ImageJ crashes, and I have to restart the process.

-Jairo
Reply | Threaded
Open this post in threaded view
|

Re: Multiple image processing optimization

BenTupper
On Nov 13, 2009, at 6:42 PM, jzapata wrote:

> I've been writing a macro to apply rotation, scaling and offset  
> corrections
> for set of 700+ images.
> The way it's coded the macro cycles through the files in the folder  
> one at a
> time. The process is very slow.
>
> What is the best way to optimize this?
>
> I've considered opening the images as a stack first and then  
> applying the
> parameters, but in practice this gives me "out of memory" errors.
>
> Is there a way of modifying the images without opening them?
>
>
>
> One less pressing concern is that from time to time while processing  
> the
> images ImageJ crashes, and I have to restart the process.
>


Hi,

It is hard to know why that crashing happens.  But to speed your  
macro, you might try the setBatchMode() macro command (http://rsb.info.nih.gov/ij/developer/macro/functions.html#S 
)

> setBatchMode(arg)
> If arg is true, the interpreter enters batch mode and images are not  
> displayed, allowing the macro to run up to 20 times faster. If arg  
> is false, exits batch mode and displays the active image in a  
> window. ImageJ exits batch mode when the macro terminates if there  
> is no setBatchMode(false) call. Note that a macro should not call  
> setBatchMode(true) more than once.


Cheers,
Ben