示例#1
0
        /// <summary>
        /// Serializes the Softcopy Presentation LUT IOD module (DICOM PS 3.3, C.11.6)
        /// </summary>
        /// <param name="module">The IOD module.</param>
        /// <param name="images">The images to be serialized.</param>
        private void SerializeSoftcopyPresentationLut(SoftcopyPresentationLutModuleIod module, DicomPresentationImageCollection <DicomGrayscalePresentationImage> images)
        {
            var inverted = false;

            if (images.Count > 0)
            {
                inverted = images.FirstImage.VoiLutManager.Invert;

                // if more than one image is being serialized in the same presentation state, and they have different inversion states, then just don't invert any of them
                foreach (var image in images)
                {
                    if (inverted != image.VoiLutManager.Invert)
                    {
                        inverted = false;
                        break;
                    }
                }
            }

            module.InitializeAttributes();
            module.PresentationLutShape = !inverted ? PresentationLutShape.Identity : PresentationLutShape.Inverse;
        }
示例#2
0
 /// <summary>
 /// Deserializes the Softcopy Presentation LUT IOD module (DICOM PS 3.3, C.11.6)
 /// </summary>
 /// <param name="module">The IOD module.</param>
 /// <param name="image">The <see cref="IPresentationImage"/> to deserialize to.</param>
 private void DeserializeSoftcopyPresentationLut(SoftcopyPresentationLutModuleIod module, DicomGrayscalePresentationImage image)
 {
     // if the presentation LUT shape is anything but inverse, always assume identity
     image.VoiLutManager.Invert = (module.PresentationLutShape == PresentationLutShape.Inverse);
 }