protected override void PerformTypeSpecificDeserialization(DicomPresentationImageCollection <DicomColorPresentationImage> images)
        {
            ColorSoftcopyPresentationStateIod iod = new ColorSoftcopyPresentationStateIod(base.DataSet);

            foreach (DicomColorPresentationImage image in images)
            {
                RectangleF displayedArea;
                this.DeserializeSpatialTransform(iod.SpatialTransform, image);
                this.DeserializeDisplayedArea(iod.DisplayedArea, out displayedArea, image);
                this.DeserializeGraphicLayer(iod.GraphicLayer, image);
                this.DeserializeGraphicAnnotation(iod.GraphicAnnotation, displayedArea, image);
                this.DeserializeOverlayPlane(iod.OverlayPlane, image);
                this.DeserializeOverlayActivation(iod.OverlayActivation, image);
                this.DeserializeBitmapDisplayShutter(iod.BitmapDisplayShutter, image);
                this.DeserializeDisplayShutter(iod.DisplayShutter, image);
            }
        }
        protected override void PerformTypeSpecificSerialization(DicomPresentationImageCollection <DicomColorPresentationImage> images)
        {
            IOverlayMapping overlayMapping;
            ColorSoftcopyPresentationStateIod iod = new ColorSoftcopyPresentationStateIod(base.DataSet);

            this.SerializePresentationStateRelationship(iod.PresentationStateRelationship, images);
            this.SerializePresentationStateShutter(iod.PresentationStateShutter);
            this.SerializeDisplayShutter(iod.DisplayShutter, images);
            this.SerializeOverlayPlane(iod.OverlayPlane, out overlayMapping, images);
            this.SerializeOverlayActivation(iod.OverlayActivation, overlayMapping, images);
            this.SerializeBitmapDisplayShutter(iod.BitmapDisplayShutter, overlayMapping, images);
            this.SerializeDisplayedArea(iod.DisplayedArea, images);
            this.SerializeGraphicAnnotation(iod.GraphicAnnotation, images);
            this.SerializeSpatialTransform(iod.SpatialTransform, images);
            this.SerializeGraphicLayer(iod.GraphicLayer, images);
            this.SerializeIccProfile(iod.IccProfile);
        }
        protected void SerializeSoftcopyVoiLut(SoftcopyVoiLutModuleIod module, DicomPresentationImageCollection <T> images)
        {
            List <SoftcopyVoiLutModuleIod.SoftcopyVoiLutSequenceItem> voiLutSequenceItems = new List <SoftcopyVoiLutModuleIod.SoftcopyVoiLutSequenceItem>();

            foreach (T image in images)
            {
                if (!image.VoiLutManager.Enabled)
                {
                    continue;
                }

                SoftcopyVoiLutModuleIod.SoftcopyVoiLutSequenceItem sequenceItem = new SoftcopyVoiLutModuleIod.SoftcopyVoiLutSequenceItem();
                sequenceItem.InitializeAttributes();
                sequenceItem.ReferencedImageSequence = new ImageSopInstanceReferenceMacro[] { CreateImageSopInstanceReference(image.Frame) };

                IVoiLut lut = image.VoiLutManager.VoiLut;
                if (lut is IDataLut)
                {
                    IDataLut voiLut = (IDataLut)lut;
                    sequenceItem.VoiLutSequence = new VoiLutSequenceItem[] { SerializeDataLut(voiLut) };
                }
                else if (lut is IVoiLutLinear)
                {
                    IVoiLutLinear voiLut = (IVoiLutLinear)lut;
                    sequenceItem.WindowWidth  = new double[] { voiLut.WindowWidth };
                    sequenceItem.WindowCenter = new double[] { voiLut.WindowCenter };
                    sequenceItem.WindowCenterWidthExplanation = new string[] { SR.LabelPresentationVoiLinearLut };
                    sequenceItem.VoiLutFunction = VoiLutFunction.Linear;                     // we don't support sigmoid
                }
                else
                {
                    // should never happen - all VOI LUT object should implement either interface
                    continue;
                }

                voiLutSequenceItems.Add(sequenceItem);
            }

            if (voiLutSequenceItems.Count > 0)
            {
                module.SoftcopyVoiLutSequence = voiLutSequenceItems.ToArray();
            }
        }
Beispiel #4
0
        protected override void PerformTypeSpecificSerialization(DicomPresentationImageCollection <DicomGrayscalePresentationImage> images)
        {
            IOverlayMapping overlayMapping;
            GrayscaleSoftcopyPresentationStateIod iod = new GrayscaleSoftcopyPresentationStateIod(base.DataSet);

            this.SerializePresentationStateRelationship(iod.PresentationStateRelationship, images);
            this.SerializePresentationStateShutter(iod.PresentationStateShutter);
            this.SerializePresentationStateMask(iod.PresentationStateMask, images);
            this.SerializeMask(iod.Mask, images);
            this.SerializeDisplayShutter(iod.DisplayShutter, images);
            this.SerializeOverlayPlane(iod.OverlayPlane, out overlayMapping, images);
            this.SerializeOverlayActivation(iod.OverlayActivation, overlayMapping, images);
            this.SerializeBitmapDisplayShutter(iod.BitmapDisplayShutter, overlayMapping, images);
            this.SerializeDisplayedArea(iod.DisplayedArea, images);
            this.SerializeGraphicAnnotation(iod.GraphicAnnotation, images);
            this.SerializeSpatialTransform(iod.SpatialTransform, images);
            this.SerializeGraphicLayer(iod.GraphicLayer, images);
            this.SerializeModalityLut(iod.ModalityLut, images);
            this.SerializeSoftcopyVoiLut(iod.SoftcopyVoiLut, images);
            this.SerializeSoftcopyPresentationLut(iod.SoftcopyPresentationLut, images);
        }
Beispiel #5
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;
        }
 protected void SerializeModalityLut(ModalityLutModuleIod module, DicomPresentationImageCollection <T> images)
 {
 }
 protected void SerializeMask(MaskModuleIod module, DicomPresentationImageCollection <T> images)
 {
     // NOTE: Not supported
 }
 protected void SerializePresentationStateMask(PresentationStateMaskModuleIod module, DicomPresentationImageCollection <T> images)
 {
     // NOTE: Not supported
     module.InitializeAttributes();
 }