public GenericGrayscalePipeline(double slope, double intercept, int bitsStored, bool signed) { int minValue = signed ? -(1 << (bitsStored - 1)) : 0; int maxValue = signed ? (1 << (bitsStored - 1)) : (1 << (bitsStored + 1) - 1); _rescaleLut = new RescaleLUT(minValue, maxValue, slope, intercept); _voiLut = new VOILinearLUT(new WindowLevel(maxValue - minValue, (minValue + maxValue) / 2)); _outputLut = new OutputLUT(ColorTable.Monochrome2); }
public GenericGrayscalePipeline(GrayscaleRenderOptions options) { if (options.RescaleSlope != 1.0 || options.RescaleIntercept != 0.0) { _rescaleLut = new RescaleLUT(options.BitDepth.MinimumValue, options.BitDepth.MaximumValue, options.RescaleSlope, options.RescaleIntercept); } _voiLut = new VOILinearLUT(options.WindowCenter, options.WindowWidth); _outputLut = new OutputLUT(options.Monochrome1 ? ColorTable.Monochrome1 : ColorTable.Monochrome2); if (options.Invert) { _invertLut = new InvertLUT(_outputLut.MinimumOutputValue, _outputLut.MaximumOutputValue); } }