Changeset 6657


Ignore:
Timestamp:
07/07/10 11:27:15 (9 years ago)
Author:
curtis
Message:

Use 'uncalibrated' values for CompositeImage min/max.

File:
1 edited

Legend:

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

    r6654 r6657  
    2828import ij.CompositeImage; 
    2929import ij.ImagePlus; 
     30import ij.measure.Calibration; 
    3031import ij.process.ColorProcessor; 
    3132import ij.process.ImageProcessor; 
     
    4243import loci.formats.DimensionSwapper; 
    4344import loci.formats.FormatException; 
    44 import loci.formats.MinMaxCalculator; 
    4545import loci.formats.FormatTools; 
    4646import loci.formats.ImageReader; 
     47import loci.formats.MinMaxCalculator; 
    4748import loci.plugins.BF; 
    4849import loci.plugins.util.ImageProcessorReader; 
     
    226227      for (int c=0; c<cSize; c++) { 
    227228        LUT lut = compImage.getChannelLut(c + 1); 
    228         lut.min = cMin[c]; 
    229         lut.max = cMax[c]; 
     229        // NB: Uncalibrate min/max values before assigning to LUT min/max. 
     230        double minOffset = 0; 
     231        final Calibration cal = imp.getCalibration(); 
     232        if (cal.getFunction() == Calibration.STRAIGHT_LINE) { 
     233          // adjust minimum offset for signed data 
     234          double[] coeffs = cal.getCoefficients(); 
     235          if (coeffs.length > 0) minOffset = coeffs[0]; 
     236        } 
     237        lut.min = cMin[c] - minOffset; 
     238        lut.max = cMax[c] - minOffset; 
    230239      } 
    231240    } 
Note: See TracChangeset for help on using the changeset viewer.