Changeset 7494


Ignore:
Timestamp:
01/10/11 15:56:37 (9 years ago)
Author:
curtis
Message:

Fix problem where custom LUTs override grayscale mode.

This happened because in some cases, the ImageProcessors already have
custom LUTs attached. We extract the LUTs and add them to a list, for
Colorizer to apply as appropriate, but in the case of grayscale,
Colorizer merely nulls the LUTs and does nothing, assuming that the
ImageProcessors are grayscale.

The fix is to revert the ImageProcessor LUTs back to the default,
prior to invoking Colorizer, so that grayscale mode works properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/loci-plugins/src/loci/plugins/in/ImagePlusReader.java

    r6949 r7494  
    184184      if (luts != null) { 
    185185        final ColorModel cm = ip.getColorModel(); 
    186         final LUT lut = cm instanceof LUT ? (LUT) cm : null; 
    187         luts.add(lut); 
     186        if (cm instanceof LUT) { 
     187          // plane has custom LUT attached; save it to the list 
     188          final LUT lut = (LUT) cm; 
     189          luts.add(lut); 
     190          // discard custom LUT from ImageProcessor 
     191          ip.setColorModel(ip.getDefaultColorModel()); 
     192        } 
     193        else { 
     194          // no LUT attached; save a placeholder 
     195          luts.add(null); 
     196        } 
    188197      } 
    189198 
Note: See TracChangeset for help on using the changeset viewer.