Process>Math>Exp

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

Process>Math>Exp

ccoffman
I am trying to figure out how the "Exp" function in ImageJ works. I initially assumed that it just does e^(pixel value) for all the pixels in the image, but with a 16-bit image, this would seem to generate incredibly large numbers. I assume there is some scaling going on, but I can't figure out exactly what it is and the official documentation says only that it "Performs an exponential transform on the active image or selection."

Does anyone have details on exactly how this works?
Reply | Threaded
Open this post in threaded view
|

Re: Process>Math>Exp

Michael Schmid
Hi Clayton,

you are right, there is some scaling in Process>Math>Exp:

For 8-bit images, scaling is the following:

  result = 255*exp(value/46.01)

The number 46.01 is 255/ln(255).

For 16-bit images, the result depends on the upper limit (named 'max') of the current display range that you set with Image>Adjust>Brightness&Contrast:

  result = exp(value*(ln(max)/max))

For signed 16-bit images (values from -32768 to 32767), the pixel value is the signed number, otherwise it is the raw (uncalibrated) unsigned 16-bit value.

So you will always get a result of exp(0) = 1 for pixel value = 0, and the maximum of the range for a pixel that has the maximum of the range. In the latter case, you might actually get max-1 due to rounding errors.

For ShortProcessors, you can see it in the code at
  https://github.com/imagej/imagej1/blob/master/ij/process/ShortProcessor.java
line 505.


Michael
________________________________________________________________
On Sep 24, 2014, at 02:17, ccoffman wrote:

> I am trying to figure out how the "Exp" function in ImageJ works. I initially
> assumed that it just does e^(pixel value) for all the pixels in the image,
> but with a 16-bit image, this would seem to generate incredibly large
> numbers. I assume there is some scaling going on, but I can't figure out
> exactly what it is and the official documentation says only that it
> "Performs an exponential transform on the active image or selection."
>
> Does anyone have details on exactly how this works?

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

Re: Process>Math>Exp

ccoffman
Thank you Michael!

Is this a standard way to scale such things?

I ask because my actual goal is to get ImageJ to do the same kind of analysis another piece of software does ("Multi Gauge" by Fujifilm, which is proprietary and dead). It also does an Exp transform, but there is no documentation I can see about how it does this.