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 #906 (closed defect: fixed)

Opened 2011-12-05T15:40:38-06:00

Last modified 2012-08-14T12:36:07-05:00

Loaded image changes shade after a few seconds

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b4-plugins
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1011

Description

Load boats. Image is drawn. Wait a few seconds. Image redraws but darker.

I think what is happening here is that the image window is created and drawn by the plugin before harmonization. Then harmonization happens and some mistranslation causes the color to shift.

Solutions to this problem might avoid harmonization of new images. Or the reason for color mistranslation could be fixed.

This pause between creation and harmonization might give rise to #905 too.

Change History

comment:1 Changed 2011-12-08T12:55:55-06:00 by bdezonia

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

Problem was legacy layer was doing some drawing and doing it before channel mins/maxes were being set. Fixed in 8f2fb69e68f77185904048801d6505e39aab83b3

comment:2 Changed 2011-12-20T11:01:27-06:00 by bdezonia

  • Status changed from closed to reopened
  • Resolution fixed deleted

Using 152c76ad5d3d9b73872fddfe46833c2b6e14c1b7 it is apparent that this issue still exists. I have verified my previous fix was not undone. Must determine what it is that is giving rise to this issue. ColorTableHarmonizer is likely involved.

comment:3 Changed 2011-12-20T12:03:15-06:00 by bdezonia

MetadataHarmonizer is involved. Inside its updateDataset() method it is setting the dataset's title. This invokes an update() call. We might want to avoid extra updates. Still this does not explain why the last update is darker. Perhaps the display range is set to 0/255 over and over and then finally to min/max at the last harmonization.

comment:4 Changed 2011-12-20T13:05:24-06:00 by bdezonia

Further tracking showed that some event is handled after the image display's update code was run. Note that making MetadataHarmonizer avoid Dataset::update() fixes the change of colors but not sure the displayed colors are exactly correct. May need to insert a Dataset::update call somewhere (LegacyPlugin? Harmonizer? caller of LegacyPlugin?). Or maybe its handled already. Needs some discussion.

comment:5 Changed 2011-12-20T13:20:08-06:00 by bdezonia

Note that making that update() avoid change keeps blobs as displaying as primarily white like IJ1. It stays primarily black.

comment:6 Changed 2011-12-20T16:46:05-06:00 by bdezonia

Here is the issue: IJ2 creates the initial display of the data with lut converter ranges nondefault (like 13 to 230). But later harmonization is run and IJ2 sets converter range to match IJ1's imp.getDisplayRange() values (0 to 255). This change is initiated by assignChannelMinMax() in ColorTableHarmonizer. This results in data drawing in two different brightnesses.

We want to have one brightness if possible. So try to show image once rather than an initial view and applied updates. Having a way to create a display that is hidden and then updating it while hidden and making visible later would be useful if possible.

Last edited 2011-12-20T16:49:09-06:00 by bdezonia

comment:7 Changed 2012-01-19T12:08:09-06:00 by bdezonia

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

comment:8 Changed 2012-02-26T22:32:20-06:00 by curtis

  • Blocking 1011 added

comment:9 Changed 2012-05-14T11:02:15-05:00 by bdezonia

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

comment:10 Changed 2012-08-14T12:36:07-05:00 by bdezonia

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

Testing with a version post beta 3 and this bug no longer exists.