Search in sources :

Example 1 with MappedFloatProcessor

use of uk.ac.sussex.gdsc.core.ij.process.MappedFloatProcessor in project GDSC-SMLM by aherbert.

the class ImageJImagePeakResults method createNewProcessor.

private ImageProcessor createNewProcessor(int imageWidth, int imageHeight) {
    // Equalised display requires a 16-bit image to allow fast processing of the histogram
    if ((displayFlags & DISPLAY_EQUALIZED) != 0) {
        pixels = new short[data.length];
        return new ShortProcessor(imageWidth, imageHeight, (short[]) pixels, null);
    }
    pixels = new float[data.length];
    // Zero is mapped to 0 in the LUT.
    if ((displayFlags & DISPLAY_MAPPED) != 0) {
        final MappedFloatProcessor fp = new MappedFloatProcessor(imageWidth, imageHeight, (float[]) pixels, null);
        fp.setMapZero((displayFlags & DISPLAY_MAP_ZERO) != 0);
        return fp;
    }
    // -Infinity is mapped to 0 in the LUT.
    if ((displayFlags & DISPLAY_NEGATIVES) != 0) {
        return new InfinityMappedFloatProcessor(imageWidth, imageHeight, (float[]) pixels, null);
    }
    return new FloatProcessor(imageWidth, imageHeight, (float[]) pixels, null);
}
Also used : InfinityMappedFloatProcessor(uk.ac.sussex.gdsc.core.ij.process.InfinityMappedFloatProcessor) MappedFloatProcessor(uk.ac.sussex.gdsc.core.ij.process.MappedFloatProcessor) FloatProcessor(ij.process.FloatProcessor) InfinityMappedFloatProcessor(uk.ac.sussex.gdsc.core.ij.process.InfinityMappedFloatProcessor) InfinityMappedFloatProcessor(uk.ac.sussex.gdsc.core.ij.process.InfinityMappedFloatProcessor) MappedFloatProcessor(uk.ac.sussex.gdsc.core.ij.process.MappedFloatProcessor) ShortProcessor(ij.process.ShortProcessor)

Aggregations

FloatProcessor (ij.process.FloatProcessor)1 ShortProcessor (ij.process.ShortProcessor)1 InfinityMappedFloatProcessor (uk.ac.sussex.gdsc.core.ij.process.InfinityMappedFloatProcessor)1 MappedFloatProcessor (uk.ac.sussex.gdsc.core.ij.process.MappedFloatProcessor)1