Ticket #545 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Enhance Contrast doesn't

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Running legacy plugin Process :: Enhance Contrast does not work unless you are using a color Dataset. Note that color Datasets synchronize data by value while all others synchronize data by reference. Might be a legacy layer issue.

Change History

comment:1 Changed 8 years ago by bdezonia

Code inspection did not turn anything up immediately. Verified that the various processors munge pixel data and do not just play with LUT. applyTable() seems to be getting called. (Note that an example Dataset that doesn't work is Boats).

comment:2 Changed 8 years ago by bdezonia

  • Milestone changed from biweekly-2011: May-23 to Jun-03 to imagej-2.0-beta1

Stepped through with debugger. The exact conditions to show problem entail using an unsigned byte image and making sure the Normalize option in the called plugin is false. If its false the only code that is run changes the display range and redraws. For color images or when normalizing eventually ip.applyTable() is called instead which will munge pixels and thus avoid the problem.

This points out a need to either track the resetting of the display range in LegacyManager and update it in IJ2 or else we need to write a pure IJ2 implementation of the ContrastEnhancer plugin.

comment:3 Changed 8 years ago by bdezonia

See ContrastEnhancer::stretchHistogram(ImageProcessor ip, double saturated, ImageStatistics stats) to see where normalize() (which munges pixels) is only called if checkbox set. Otherwise just ip.setMinAndMax() is called that has no effect on pixel values.

comment:4 Changed 8 years ago by bdezonia

After discussions have determined that we will need to capture the setting of the discplay range in the legacy layer. Probably via ip.setMinAndMax(). When captured we'll need to set the display range for the correct Display (or display view).

comment:5 Changed 8 years ago by bdezonia

Waiting for display <--> imageplus mapping in legacy layer to be completed.

comment:6 Changed 7 years ago by bdezonia

Capture this method of ImageProcessor?
public void setThreshold(double minThreshold, double maxThreshold, int lutUpdate)

Or this method of ImageProcessor?
abstract public void setMinAndMax() ?

Will tracking this cause performance issues?

comment:7 Changed 7 years ago by bdezonia

Need to think about the tricky issue: how to go from an ImageProcessor to an ImagePlus so we can eventually get back to a Display.

comment:8 Changed 7 years ago by bdezonia

  • Owner changed from bdezonia to afraser
  • Status changed from new to assigned

Testing with 4def5b7e289d3c0c62405f5fbd415ee56b4f3467 can no longer duplicate the problem. Perhaps Adam changed something with his recent brightness/contrast work. Passing on for clarification.

comment:9 Changed 7 years ago by bdezonia

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

This appears fixed with Curtis recent changes for setting diplay mins/maxes from IJ1. I have extended code in legacy layer with commit 9f56a63c98ac6bda648c131c8a1c80013b90910a that completes the range setting from IJ2 to IJ1.

comment:10 Changed 7 years ago by bdezonia

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:11 Changed 7 years ago by bdezonia

  • Owner changed from afraser to bdezonia
  • Status changed from reopened to assigned

comment:12 Changed 7 years ago by bdezonia

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.