Ticket #906 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

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

comment:7 Changed 7 years ago by bdezonia

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

comment:8 Changed 7 years ago by curtis

  • Blocking 1011 added

comment:9 Changed 7 years ago by bdezonia

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

comment:10 Changed 7 years ago 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.

Note: See TracTickets for help on using tickets.