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

Opened 2011-05-19T13:01:33-05:00

Last modified 2011-06-02T16:23:30-05:00

Update LUTs correctly in DatasetHarmonizer

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

Description

DatasetHarmonizer does nothing about bringing LUTs across from IJ1. So if you take a RGB image (like clown), convert to HSB stack (via IJ1 menu plugin) you get the resulting image displayed with three LUTS (R,G,B) with one for each channel as opposed to IJ1's single grayscale LUT. Our UI code defaults to R,G,B for the LUTs since the harmonizer has not assigned anything to the ColorTables of the ImgPlus of the Dataset.

Change History

comment:1 Changed 2011-05-19T13:47:08-05:00 by bdezonia

Rough notes of discussion with Curtis:

An ImgPlus has ColorTables (1 per plane)

CompositeXYProjector uses ColorTables too (1 per channel)

In a view (DatasetView?) make sure my channel luts match the IJ1 CompositeImage luts. Or map in Dataset and set correctly for every plane. In Dataset case, for every plane, get channel index from rasterized plane index and set lut from CompositeImage.

If not a CompositeImage then we have 1 lut. Set for entire Dataset. IJ1 may give back null lut in this case which means we should set the Dataset's lut to gray.

Future cleverness: rather than set all the luts for the Dataset after each image change in IJ1 we could be smart about using the CodeHacker and detect when a lut has changed and only update the Dataset's lut when needed. Low priority aspect of this ticket.

comment:2 Changed 2011-05-31T14:54:27-05:00 by bdezonia

After some later discussions with Curtis it was decided that LUT setting from an ImagePlus should not set the Dataset's LUTs but rather the channel ColorTables in the Views that display the Dataset. Support for this code is a little hacky until the legacy layer is modified to map Display <--> ImagePlus.

As of 46f0ea91390b6c611e0f30ab353e4ed72d3091ac the following support is in place:

  • IJ1 to IJ2: view luts getting set (known issues reported elsewhere)
  • IJ2 to IJ1: unimplemented

Notes on IJ2 to IJ1 :

  • steal code from BioFormats' Colorizer (around line 150).
  • if our Dataset composite channel count says this is not composite

then imp.getProcessor().setColorModel(LUT) making the LUT from 1st plane's
ColorTable in Dataset

  • otherwise if Composite then in legacy layer make a CompositeImage to send to IJ1.

Can then set channel LUTs from Dataset. If channels not between 2 and 7. Then
default to previously outlined case.

comment:3 Changed 2011-05-31T14:57:01-05:00 by bdezonia

  • Priority changed from minor to major

comment:4 Changed 2011-05-31T15:17:54-05:00 by bdezonia

  • Status changed from new to accepted

comment:5 Changed 2011-06-02T16:23:24-05:00 by bdezonia

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

This code in place. Final touches added in 4e2c537eaebb6ff01a3a873f212df9ab35e16ce1 but most work done in 585ace3adc2bc1646d04c2ca01b557fc9d2e0ffa.

comment:6 Changed 2011-06-02T16:23:30-05:00 by bdezonia

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