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 931 - Possible error when down-converting from 32- or 16-bit-depth images (to 16- or 8-bit).
Possible error when down-converting from 32- or 16-bit-depth images (to 16- o...
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: ImageJ1
unspecified
PC Linux
: P5 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-09-18 08:58 CDT by Leonard Guizzetti
Modified: 2014-09-18 09:55 CDT
1 user (show)

See Also:

Description Leonard Guizzetti 2014-09-18 08:58:35 CDT
I seem to have a problem down-converting 32-bit to 16- or 8-bit images, or from 16-bit to 8 bit. It appears that even if the image histogram fits neatly inside an 8-bit image, down-converting causes a re-scaling of all pixel values. My FIJI and ImageJ1 are up-to-date.


Steps taken to produce the problem:
1) SCIFIO is off.

2) Open Blobs sample (ctrl+shift+b)

3) Measure original image statistics. Pixel values range from 8-248 (originally 8-bit colour image).

4) Convert image to 32-bit, and measure image stats. Pixel values remain the same.

5) Convert back to 8-bit, and measure image stats. Now, pixel values range from 0-255, and histogram has been stretched to fit entire 8-bit range.

This behaviour seems abnormal to me, as I wouldn't expect the scaling to occur, and could be destructive for image manipulation.
Comment 1 Leonard Guizzetti 2014-09-18 08:59:44 CDT
Here's the information collected by FIJI about my installation and system.

Information about your version of Java:

  os.arch => amd64
  os.name => Linux
  os.version => 3.13.0-35-generic
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => gnome
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: /opt/fiji/java/linux-amd64/jdk1.6.0_24//jre
  imagej.dir => /opt/fiji

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140916111414)
Fiji: http://fiji.sc/update/ (last check:20140917173425)
Comment 2 Wayne Rasband 2014-09-18 09:55:44 CDT
You can disable scaling when down-converting by unchecking "Scale when converting" in Edit>Options>Conversions. The example macro below outputs

  'Scale when converting' checked
  8: 8-248
  32: 8-248
  8: 0-255
  'Scale when converting' not checked
  8: 8-248
  32: 8-248
  8: 8-248


  // test "Scale when converting" option
  setBatchMode(true);
  run("Conversions...", "scale");
  print("'Scale when converting' checked");
  run("Blobs (25K)");
  printRange();
  run("32-bit");
  printRange();
  run("8-bit");
  printRange();
  print("'Scale when converting' not checked");
  run("Conversions...", " ");
  run("Blobs (25K)");
  printRange();
  run("32-bit");
  printRange();
  run("8-bit");
  printRange();

  function printRange() {
      getStatistics(area, mean, min, max);
      print(bitDepth+": "+min+"-"+max);
  }