コード例 #1
0
ファイル: OutputLUTTest.cs プロジェクト: aerik/fo-dicom
 public void ColorMap_Monochrome2ImageOptions_ReturnsMonochrome2ColorMap()
 {
     var file = DicomFile.Open(@".\Test Data\CT1_J2KI");
     var options = GrayscaleRenderOptions.FromDataset(file.Dataset);
     var lut = new OutputLUT(options);
     Assert.Same(ColorTable.Monochrome2, lut.ColorMap);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        public void ColorMap_Monochrome2ImageOptions_ReturnsMonochrome2ColorMap()
        {
            var file    = DicomFile.Open(@".\Test Data\CT1_J2KI");
            var options = GrayscaleRenderOptions.FromDataset(file.Dataset);
            var lut     = new OutputLUT(options);

            Assert.Same(ColorTable.Monochrome2, lut.ColorMap);
        }
コード例 #4
0
 /// <summary>
 /// Initialize new instance of <seealso cref="GenericGrayscalePipeline"/> which consist of the following sequence
 /// Rescale (Modality) LUT -> VOI LUT -> Output LUT and optionally Invert LUT if specified by grayscale options
 /// </summary>
 /// <param name="options">Grayscale options to use in the pipeline</param>
 public GenericGrayscalePipeline(GrayscaleRenderOptions options)
 {
     _options = options;
     if (_options.RescaleSlope != 1.0 || _options.RescaleIntercept != 0.0) _rescaleLut = new ModalityLUT(_options);
     _voiLut = VOILUT.Create(_options);
     _outputLut = new OutputLUT(_options);
     if (_options.Invert) _invertLut = new InvertLUT(_outputLut.MinimumOutputValue, _outputLut.MaximumOutputValue);
 }
コード例 #5
0
 /// <summary>
 /// Initialize new instance of <seealso cref="GenericGrayscalePipeline"/> which consist of the following sequence
 /// Rescale (Modality) LUT -> VOI LUT -> Output LUT and optionally Invert LUT if specified by grayscale options
 /// </summary>
 /// <param name="options">Grayscale options to use in the pipeline</param>
 public GenericGrayscalePipeline(GrayscaleRenderOptions options)
 {
     if (options.RescaleSlope != 1.0 || options.RescaleIntercept != 0.0)
         _rescaleLut = new ModalityLUT(options);
     _voiLut = VOILUT.Create(options);
     _outputLut = new OutputLUT(options.Monochrome1 ? ColorTable.Monochrome1 : ColorTable.Monochrome2);
     if (options.Invert)
         _invertLut = new InvertLUT(_outputLut.MinimumOutputValue, _outputLut.MaximumOutputValue);
 }
コード例 #6
0
 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);
 }