Overlaying thousands of images with transparent backgrounds

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

Overlaying thousands of images with transparent backgrounds

XBYJ
Hi everyone.

I have thousands of images, showing the progression of a falling particle in slow motion, which I need to combine into a single image to create a visual track of the particle's progression.

I have used an ImageJ macro to batch-convert the images to binary (the particle is black, the background is white). I have then converted the binary images to 32-bit TIFF and set v=0 to NaN. So for each image, the particle has a value of 255 and the background has a value of NaN.

How would I then overlay all the images so that the particles are black and the background NaN values are white?

Thank you so much for any help.
Reply | Threaded
Open this post in threaded view
|

Re: Overlaying thousands of images with transparent backgrounds

Michael Schmid
Hi Jennifer,

if you don't have NaNs but a stack of binary images, you can use Image>Stacks>Z Project.
If the particle has a pixel value of 0 (black) and the background is 255, the minimum of all stack slices will be black in all positions where you have a particle in any slice.
If the particle has a pixel value of 255 (white) and the background is 0, the maximum of all stack slices will be white at positions where the particle has passed.
With background value=0 and a nonzero value for the particle, you can also use the sum of all slices. The positions where the particle is in more than one stack slice will become brighter.

  http://rsb.info.nih.gov/ij/docs/guide/146-28.html#toc-Subsubsection-28.6.11

Michael
________________________________________________________________
On Feb 24, 2016, at 16:15, XBYJ wrote:

> Hi everyone.
>
> I have thousands of images, showing the progression of a falling particle in
> slow motion, which I need to combine into a single image to create a visual
> track of the particle's progression.
>
> I have used an ImageJ macro to batch-convert the images to binary (the
> particle is black, the background is white). I have then converted the
> binary images to 32-bit TIFF and set v=0 to NaN. So for each image, the
> particle has a value of 255 and the background has a value of NaN.
>
> How would I then overlay all the images so that the particles are black and
> the background NaN values are white?
>
> Thank you so much for any help.

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

Re: Overlaying thousands of images with transparent backgrounds

Kenneth Sloan-2
That would work IFF all of the images will fit.

In case they don’t, I would consider:
a) create a blank image - call it CumulativeImage
b) use the Batch feature to add one image at a time to the CumulativeImage

There are probably several ways to perform step b) - the simplest is probably to:

c) create a stack containing the CumulativeImage and the next image in the sequence
d) use Image>Stacks>Z Project
e) save the result as “CumulativeImage”

WE have found that Stack processing works really well for a small volume - but when the images get really big, or there are a lot of them, we have to revert to Batch to process the images one at a time.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.




> On Feb 24, 2016, at 10:41 , Michael Schmid <[hidden email]> wrote:
>
> Hi Jennifer,
>
> if you don't have NaNs but a stack of binary images, you can use Image>Stacks>Z Project.
> If the particle has a pixel value of 0 (black) and the background is 255, the minimum of all stack slices will be black in all positions where you have a particle in any slice.
> If the particle has a pixel value of 255 (white) and the background is 0, the maximum of all stack slices will be white at positions where the particle has passed.
> With background value=0 and a nonzero value for the particle, you can also use the sum of all slices. The positions where the particle is in more than one stack slice will become brighter.
>
>  http://rsb.info.nih.gov/ij/docs/guide/146-28.html#toc-Subsubsection-28.6.11
>
> Michael
> ________________________________________________________________
> On Feb 24, 2016, at 16:15, XBYJ wrote:
>
>> Hi everyone.
>>
>> I have thousands of images, showing the progression of a falling particle in
>> slow motion, which I need to combine into a single image to create a visual
>> track of the particle's progression.
>>
>> I have used an ImageJ macro to batch-convert the images to binary (the
>> particle is black, the background is white). I have then converted the
>> binary images to 32-bit TIFF and set v=0 to NaN. So for each image, the
>> particle has a value of 255 and the background has a value of NaN.
>>
>> How would I then overlay all the images so that the particles are black and
>> the background NaN values are white?
>>
>> Thank you so much for any help.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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