Re: Infinity values

Posted by Rasband, Wayne (NIH/NIMH) [E] on
URL: http://imagej.273.s1.nabble.com/Infinity-values-tp3686956p3686957.html

On Sep 12, 2010, at 2:54 PM, Francis Burton wrote:

> Hi,
>
> I'm running a plugin (Ratio Plus) that creates an image with pixel
> values equal to Infinity, as a result of zero divisions. I would
> like these pixels to have some other value, so that I can decide
> what colour they will appear as. Setting the "Divide by zero value"
> in Edit/Options/Misc... doesn't work, presumably because it only
> applies to the built-in image arithmetic and not variables in
> plugins. So is there an easy (i.e. menu item ) way I can turn all
> Infinity values into some other value? Alternatively, could this
> function be implemented in a macro? Or would I have to write a
> plugin to do it (or modify the original plugin)?

You can use the changeValues() macro function to do this. For example

  changeValues(1/0, 1/0, 0);

changes all the Infinity values in the current image to zero.

-wayne