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

Opened 2011-10-26T13:41:39-05:00

Last modified 2011-11-02T16:00:54-05:00

Select All/Copy behaving badly

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

Description

The Copy command is not working correctly. Load blobs. If you Edit Select All (IJ1 version) and and Edit Copy the selection the displayed pixels are replaced with a monochrome green image. If you originally Edit Select All (IJ2 version) and then Edit Copy the original image inverts (maybe a color table changed?).

Change History

comment:1 Changed 2011-10-26T13:41:56-05:00 by bdezonia

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

comment:2 Changed 2011-10-26T14:10:39-05:00 by bdezonia

In the case of image inverting note that this looks like a legacy layer issue with inverted lut images. For instance, one can load blobs and show info and the image inverts.

comment:3 Changed 2011-10-31T12:34:06-05:00 by bdezonia

Image/LUT inversion opened as separate ticket: #849

comment:4 Changed 2011-10-31T14:06:50-05:00 by bdezonia

One can confirm with the probe that the pixel values are correctly maintained. The green square is just an overlay that is drawn over the image entirely. The problem has to do with overlay harmonization.

comment:5 Changed 2011-11-01T13:21:57-05:00 by bdezonia

It's not really a harmonization issue. It's an overlay that is correctly created by the OverlayHarmonizer. It's just getting drawn incorrectly. Not sure if this is a JHotDraw bug or some logic error in SwingOverlayView. (Outside chance its a display timing issue)

comment:6 Changed 2011-11-02T15:39:07-05:00 by bdezonia

It looks like it's a problem with keeping the alpha value in sync during harmonization back and forth across the legacy layer. Removing a single call of setAlpha() in OverlayHarmonizer makes the problem go away. More details to follow.

comment:7 Changed 2011-11-02T15:58:21-05:00 by bdezonia

Simple fix: encode the overlay's alpha value in the Roi's color. Then on translation back take the Roi's color's alpha component and use it to set the overlay's alpha. This seems to keep a handle on things.

It might be better to binarize IJ2 alpha values to 0/255 on translation to IJ1. Coming back would then be difficult. However if we started maintaining a Overlay<->Roi mapping (like we do for Display<->ImagePlus) then we could recover alpha values correctly.

comment:8 Changed 2011-11-02T16:00:54-05:00 by bdezonia

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

Fixed as mentioned in previous comment in 343a5beb8751894ebb3ea00d595993c313369449.