How ImageJ handle with negative value during image subtraction

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

How ImageJ handle with negative value during image subtraction

pang
Dear colleagues,

I have a question "How imageJ handles with negative value during image subtraction?"  In reality when we perform image subtraction, we could have some negative value.

Could anyone points me to the original code for this?

As a biologist, I prefer to set those negative values to zero  or one.

Thanks,

Zhengyu

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

Re: How ImageJ handle with negative value during image subtraction

samjlord
I believe 32bit images can have negative values, at least in ImageJ. 8bit and 16bit images should set the negative values to 0.
Reply | Threaded
Open this post in threaded view
|

Re: How ImageJ handle with negative value during image subtraction

Michael Schmid
In reply to this post by pang
Hi Zhengyu,

if you have 32-bit (float) images, negative values are no problem.

For all other data types, ImageJ does clipping to 0 for any values that would be negative as a result of any operation, such as subtraction. In other words, these values are set to 0.

If the result would be higher than the maximum value, which is 255 for 8-bit and the color channels of RGB images (65535 in 16-bit images), ImageJ does clipping to that maximum value.

  http://en.wikipedia.org/wiki/Clipping_%28signal_processing%29

The built-in "Subtract Background" command is a special case: it adds a slight offset to the result to avoid negative values that would result from subtracting a background from noisy data. Thus, it does not set the background to exactly 0 (or exactly the maximum value).

Michael
________________________________________________________________
On Nov 6, 2012, at 18:07, Pang, Zhengyu (GE Global Research) wrote:

> Dear colleagues,
>
> I have a question "How imageJ handles with negative value during image subtraction?"  In reality when we perform image subtraction, we could have some negative value.
>
> Could anyone points me to the original code for this?
>
> As a biologist, I prefer to set those negative values to zero  or one.
>
> Thanks,
>
> Zhengyu

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