Ticket #848 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

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 8 years ago by bdezonia

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

comment:2 Changed 8 years ago 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 8 years ago by bdezonia

Image/LUT inversion opened as separate ticket: #849

comment:4 Changed 8 years ago 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 8 years ago 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 8 years ago 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 8 years ago 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 8 years ago by bdezonia

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

Fixed as mentioned in previous comment in 343a5beb8751894ebb3ea00d595993c313369449.

Note: See TracTickets for help on using tickets.