Esempio n. 1
0
        /// <summary>
        /// Creates a fresh copy of the <see cref="DicomColorPresentationImage"/>.
        /// </summary>
        /// <remarks>
        /// This will instantiate a fresh copy of this <see cref="DicomColorPresentationImage"/>
        /// using the same construction parameters as the original.
        /// </remarks>
        /// <returns></returns>
        public override IPresentationImage CreateFreshCopy()
        {
            DicomColorPresentationImage image = new DicomColorPresentationImage(Frame);

            image.PresentationState = this.PresentationState;
            return(image);
        }
Esempio n. 2
0
        /// <summary>
        /// Cloning constructor.
        /// </summary>
        protected DicomColorPresentationImage(DicomColorPresentationImage source, ICloningContext context)
            : base(source, context)
        {
            Frame frame = source.Frame;

            _frameReference = frame.CreateTransientReference();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates the presentation image for a given image frame.
        /// </summary>
        /// <param name="frame">The image frame from which a presentation image is to be created.</param>
        /// <returns>The created presentation image.</returns>
        protected virtual IPresentationImage CreateImage(Frame frame)
        {
            if (frame.PhotometricInterpretation == PhotometricInterpretation.Unknown)
            {
                throw new Exception("Photometric interpretation is unknown.");
            }

            IDicomPresentationImage image;

            if (!frame.PhotometricInterpretation.IsColor)
            {
                image = new DicomGrayscalePresentationImage(frame);
            }
            else
            {
                image = new DicomColorPresentationImage(frame);
            }

            if (image.PresentationState == null || Equals(image.PresentationState, PresentationState.DicomDefault))
            {
                image.PresentationState = DefaultPresentationState;
            }

            return(image);
        }