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

Opened 2011-05-31T14:26:24-05:00

Last modified 2011-06-06T12:20:38-05:00

Type changer not working with color data correctly

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: May-23 to Jun-03
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Open Clown. Change Image :: Type to 12-bit. Display does not change. Change type back to Color RGB. Exception thrown.

I think the first problem is that the TypeChanger does not set RGBMerged to false when appropriate.

The second problem requires that changing to color fail more gracefully when passing it incompatible input data. Or do some kind of image translation if needed.

Change History

comment:1 Changed 2011-06-03T12:24:13-05:00 by bdezonia

Display now getting updated (handled in 5c2e879952b4ad11a2501d0350386aea344b41f9).

Exception in 2nd part of error no longer happens. Instead a new issue arises when you change the 12-bit 3 channel image back to COLOR RGB. The channel slider does not go away. It exists and moving it has no effect (like the image thinks its RGB). But a Z slider is still there. And moving it causes the separated 3 planes to be drawn in various shades of grey.

I would expect the correct behavior would be that trying to run this plugin would have no effect on 3-channel 12-bit data.

comment:2 Changed 2011-06-03T15:00:46-05:00 by bdezonia

  • Status changed from new to accepted

comment:3 Changed 2011-06-03T15:01:29-05:00 by bdezonia

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

comment:4 Changed 2011-06-03T16:57:54-05:00 by bdezonia

Its getting farther now. From RGB to 12-bit works. From 12-bit to RGB throws an exception.

Basically the legacy layer color translation support always assumes for RGB that num channels == 1. Need to fix this assumption. The color translator should only get called when chan == 1 & type = RGB (and the other direction when chan == 3 & isRGBMerged & unsigned 8 bit int). Otherwise do grayscale translation. And thus grayscale translation has to be enhanced to do the occasional RGB image translation to gray.

comment:5 Changed 2011-06-06T12:20:38-05:00 by bdezonia

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

Created MixedModeTranslator that is invoked for multichannel color ImagePluses. Fixes this bug in 574c3f2c3f9ac6af941ef326f585eecef29c845c.