Ticket #695 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

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 8 years ago 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 8 years ago by bdezonia (previous) (diff)

comment:2 Changed 8 years ago by bdezonia

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

comment:3 Changed 8 years ago by bdezonia

  • Component changed from ij-ext to ij-plugins

comment:4 Changed 7 years ago by bdezonia

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

comment:5 Changed 7 years ago by bdezonia

  • Blocking 1333 added

comment:6 Changed 7 years ago by bdezonia

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

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

Note: See TracTickets for help on using tickets.