/// <summary> /// Constructor. /// </summary> /// <param name="pixelData">The pixel data the algorithm will be run on.</param> /// <param name="modalityLut">The modality lut to use for calculating <see cref="WindowWidth"/> and <see cref="WindowCenter"/>, if applicable.</param> protected AlgorithmCalculatedVoiLutLinear(GrayscalePixelData pixelData, IModalityLut modalityLut) { Platform.CheckForNullReference(pixelData, "pixelData"); _pixelData = pixelData; _modalityLut = modalityLut; _windowWidth = double.NaN; _windowCenter = double.NaN; }
/// <summary> /// Calculates and returns the minimum and maximum pixel values in the input <paramref name="pixelData"/>. /// </summary> /// <param name="pixelData">The input pixel data.</param> /// <param name="windowStart">Returns the minimum pixel value.</param> /// <param name="windowEnd">Returns the maximum pixel value.</param> protected override void CalculateWindowRange(GrayscalePixelData pixelData, out int windowStart, out int windowEnd) { pixelData.CalculateMinMaxPixelValue(out windowStart, out windowEnd); }
/// <summary> /// Constructor. /// </summary> /// <param name="pixelData">The pixel data the algorithm will be run on.</param> public MinMaxPixelCalculatedLinearLut(GrayscalePixelData pixelData) : base(pixelData) { }
/// <summary> /// Constructor. /// </summary> /// <remarks> /// The input <see cref="IVoiLut"/> object can be null. /// </remarks> /// <param name="pixelData">The pixel data the algorithm will be run on.</param> /// <param name="modalityLut">The modality lut to use for calculating <see cref="AlgorithmCalculatedVoiLutLinear.WindowWidth"/> /// and <see cref="AlgorithmCalculatedVoiLutLinear.WindowCenter"/>, if applicable.</param> public MinMaxPixelCalculatedLinearLut(GrayscalePixelData pixelData, IModalityLut modalityLut) : base(pixelData, modalityLut) { }
/// <summary> /// Constructor. /// </summary> /// <param name="pixelData">The pixel data the algorithm will be run on.</param> protected AlgorithmCalculatedVoiLutLinear(GrayscalePixelData pixelData) : this(pixelData, null) { }
/// <summary> /// Called when either of <see cref="WindowWidth"/> or <see cref="WindowCenter"/> are first accessed. /// </summary> /// <remarks> /// Inheritors must implement this method and return the <paramref name="windowStart"/> and <paramref name="windowEnd"/> /// value range that will be used to calculate the <see cref="WindowWidth"/> and <see cref="WindowCenter"/>. /// </remarks> /// <param name="pixelData">The pixel data that is to be used to calculate <paramref name="windowStart"/> and <paramref name="windowEnd"/>.</param> /// <param name="windowStart">returns the start value in the window range.</param> /// <param name="windowEnd">returns the end value in the window range.</param> protected abstract void CalculateWindowRange(GrayscalePixelData pixelData, out int windowStart, out int windowEnd);