NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 384 - LUT ignored when images have no CoordinateTransform
LUT ignored when images have no CoordinateTransform
Status: CLOSED WONTFIX
Product: Fiji
Classification: Unclassified
Component: TrakEM2
unspecified
All All
: P2 normal
Assigned To: Albert Cardona
Depends on:
Blocks:
 
Reported: 2011-11-30 10:48 CST by Stephan Saalfeld
Modified: 2012-04-20 23:11 CDT
0 users

See Also:

Description Stephan Saalfeld 2011-11-30 10:48:36 CST
Only images that have a CoordinateTransform respect the IndexColorModel applied to the ImageProcessor.  When the CoordinateTransform is removed, images are rendered using a default gray LUT.

Test by applying the following Beanshell as a preprocessor script:

blue.bsh

byte[] r = new byte[ 256 ];
byte[] g = new byte[ 256 ];
byte[] b = new byte[ 256 ];
for ( int i = 0; i < 256; ++i )
  b[ i ] = ( byte )i;

imp.getProcessor().setColorModel( new java.awt.image.IndexColorModel( 8, 256, r, g, b ) );

Current workaround: Trigger the CoordinateTransform rendering mode by applying an identity transform as CoordinateTransform to all patches:

for ( patch : Display.getFront().getLayerSet().getDisplayables( Patch.class) )
  patch.setCoordinateTransform(
    new mpicbg.trakem2.transform.TranslationModel2D() );

Still, a fix would be nice :)
Comment 1 Albert Cardona 2011-12-02 10:57:34 CST
Two comments:

1) ImageProcessor.duplicate() does not copy over the ColorModel for some reason. I've pushed a fix to Patch.createTransformedImage() that addresses this.

2) Your mapping.createMappedMaskedImageInterpolated does not seem to copy the ColorModel either. How come then images with coordinate transforms respect the LUT?
Comment 2 Johannes Schindelin 2012-04-20 22:41:02 CDT
Adjusting the status to reality.
Comment 3 Albert Cardona 2012-04-20 23:11:29 CDT
This error was fixed long ago.