NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #695 (closed defect: fixed)

Opened 2011-07-27T13:21:20-05:00

Last modified 2012-08-27T15:16:56-05:00

invert broken

Reported by: afraser Owned by: bdezonia
Priority: minor Milestone: imagej2-b4-plugins
Component: Plugins Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1333

Description

Invert via the legacy layer AND via the new plugin exhibit the same behavior on the Boats sample image. When run you'll notice that the shadow tones on the underside of the boats become completely white. It seems that this is only a problem with uint8 images whose min,max is in between (0,255).

Running ImageJ1 and inverting the same Boats image, you can see that the tonal range beneath the boats is preserved.

afraser attempted to fix this by removing the if condition at the beginning of imagej.core.plugins.assign.InvertDataValues.run() so min,max are always calculated by calcValueRange(). This produces something very close to what we see in ij1, but the shadows in the inverted image appear slightly darker.

Ideally we can create a unit test around this case as well as some set of functions that we can call to perform the same set of operations in IJ1 as in IJ2 (possibly both the legacy layer and the new plugins) and compare the results after each step. This way other tests can be written to check for similar incongruities.

Change History

comment:1 Changed 2011-07-29T11:04:13-05:00 by bdezonia

Curtis used brightness/contrast adjustment to show the pixel values are the same. This also confirmed that the 8-bit special case code in InvertDataValues is required.

Make a new preference that user can set in a dialog or during program installation that says "be compatible with IJ1 here" or "do it IJ2 way". The InvertDataValues plugin could lookup the pref and decide whether to run special case code or not.

Last edited 2012-02-09T12:10:00-06:00 by bdezonia

comment:2 Changed 2011-09-21T14:56:42-05:00 by bdezonia

  • Milestone changed from imagej-2.0-beta1 to imagej-2.0-beta2

comment:3 Changed 2011-10-13T13:49:22-05:00 by bdezonia

  • Component changed from ij-ext to ij-plugins

comment:4 Changed 2012-05-14T10:58:01-05:00 by bdezonia

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4

comment:5 Changed 2012-07-17T16:01:35-05:00 by bdezonia

  • Blocking 1333 added

comment:6 Changed 2012-08-27T15:16:56-05:00 by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

The legacy mode code is in place with this commit: 4452504ddb4054f65d96b3845c66e407b15e79fe