NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 947 - Log of 32-bit Images
Log of 32-bit Images
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: ImageJ2
unspecified
PC Windows
: P5 minor
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-10-21 12:19 CDT by matthew.morgan.taylor
Modified: 2014-10-22 23:43 CDT
1 user (show)

See Also:

Description matthew.morgan.taylor 2014-10-21 12:19:33 CDT
Hope it isn't an issue I'm not including a macro, but it does not get much simpler than this.

For 32-bit images, pixel values for which the log would be undefined (values less than or equal to 0) return zero instead of NaN. Since this amounts to taking pixels of undefined value and plopping them immediately in the middle of the range of output values (as log is defined for the range (0, infinity]) , its more than a little troubling. 

If this could be addressed, I'd be quite pleased. I also would be quite happy if log caused a zero pixel to take on the value negative infinity - even if it isn't explicitly correct outside of a limit, it is a very useful approximation.

Thanks
Comment 1 Wayne Rasband 2014-10-22 23:43:47 CDT
In the latest daily build (1.49j9), ImageJ uses Math.log() to process all values in float images. This is the description of Math.log():

  Returns the natural logarithm (base e) of a double
  value.  Special cases:
    * If the argument is NaN or less than zero, then 
      the result is NaN.
    * If the argument is positive infinity, then the
      result is positive infinity.
    * If the argument is positive zero or negative zero, 
      then the result is negative infinity.