Login  Register

Re: Selecting images without activating them

Posted by Gabriel Landini on Dec 16, 2006; 6:32am
URL: http://imagej.273.s1.nabble.com/Selecting-images-without-activating-them-tp3700808p3700811.html

On Friday 15 December 2006 20:07, Dr W.G. Rees wrote:
> All I know how to do in ImageJ is SelectImage, which
> activates the image. Using this, even a very modest macro that simply
> switches between two open images and back again for each pixel in
> turn, takes an impossibly long time (hours) to run,

A further suggestion to the batch mode flag:
There is obviously an overhead in switching to an image and accessing a pixel
from it, so if you do this for every pixel, it becomes quite time consuming.
What you can do instead is to read the entire images into arrays and then work
from the arrays, so you access only the target image (to put the result) and
save all the overhead processing of the switching.
For this, plugins are better than macros. The macro language (unlike plugins)
does not support 2D arrays, so one has to store the image as a 1D array.
1D arrays in plugins are also faster to process than 2D arrays.

I hope it helps,

Gabriel