Esempio n. 1
0
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		/// <param name="source">The source object from which to clone.</param>
		/// <param name="context">The cloning context object.</param>
		protected FusionPresentationImage(FusionPresentationImage source, ICloningContext context) : base(source, context)
		{
			context.CloneFields(source, this);

			_baseFrameReference = source._baseFrameReference.Clone();
			_overlayFrameDataReference = source._overlayFrameDataReference.Clone();
		}
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>
        /// Cloning constructor.
        /// </summary>
        /// <param name="source">The source object from which to clone.</param>
        /// <param name="context">The cloning context object.</param>
        protected FusionPresentationImage(FusionPresentationImage source, ICloningContext context) : base(source, context)
        {
            context.CloneFields(source, this);

            _baseFrameReference        = source._baseFrameReference.Clone();
            _overlayFrameDataReference = source._overlayFrameDataReference.Clone();
        }
Esempio n. 4
0
        /// <summary>
        /// Cloning constructor.
        /// </summary>
        /// <param name="source">The source object from which to clone.</param>
        /// <param name="context">The cloning context object.</param>
        protected VtkTestPresentationImage(VtkTestPresentationImage source, ICloningContext context)
            : base(source, context)
        {
            context.CloneFields(source, this);

            _frameReference = source._frameReference.Clone();
        }
        /// <summary>
        /// Cloning constructor.
        /// </summary>
        protected DicomGrayscalePresentationImage(DicomGrayscalePresentationImage source, ICloningContext context)
            : base(source, context)
        {
            Frame frame = source.Frame;

            _frameReference = frame.CreateTransientReference();
            _dicomVoiLuts   = new DicomVoiLuts(this);
        }
Esempio n. 6
0
        /// <summary>
        /// Dispose method.  Inheritors should override this method to do any additional cleanup.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing && _frameReference != null)
            {
                _frameReference.Dispose();
                _frameReference = null;
            }

            base.Dispose(disposing);
        }
Esempio n. 7
0
		public FusionPresentationImage(IFrameReference baseFrame, IFusionOverlayFrameDataReference overlayFrameData)
			: base(CreateGrayscaleImageGraphic(baseFrame),
			       baseFrame.Frame.NormalizedPixelSpacing.Column,
			       baseFrame.Frame.NormalizedPixelSpacing.Row,
			       baseFrame.Frame.PixelAspectRatio.Column,
			       baseFrame.Frame.PixelAspectRatio.Row)
		{
			_baseFrameReference = baseFrame;
			_overlayFrameDataReference = overlayFrameData;

			Initialize();
		}
Esempio n. 8
0
        public FusionPresentationImage(IFrameReference baseFrame, IFusionOverlayFrameDataReference overlayFrameData)
            : base(CreateGrayscaleImageGraphic(baseFrame),
                   baseFrame.Frame.NormalizedPixelSpacing.Column,
                   baseFrame.Frame.NormalizedPixelSpacing.Row,
                   baseFrame.Frame.PixelAspectRatio.Column,
                   baseFrame.Frame.PixelAspectRatio.Row)
        {
            _baseFrameReference        = baseFrame;
            _overlayFrameDataReference = overlayFrameData;

            Initialize();
        }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of <see cref="DicomColorPresentationImage"/>.
 /// </summary>
 /// <param name="frameReference">A <see cref="IFrameReference">reference</see> to the frame from which to construct the image.</param>
 public DicomColorPresentationImage(IFrameReference frameReference)
     : base(frameReference.Frame.Rows,
            frameReference.Frame.Columns,
            frameReference.Frame.NormalizedPixelSpacing.Column,
            frameReference.Frame.NormalizedPixelSpacing.Row,
            frameReference.Frame.PixelAspectRatio.Column,
            frameReference.Frame.PixelAspectRatio.Row,
            frameReference.Frame.GetNormalizedPixelData)
 {
     _frameReference        = frameReference;
     base.PresentationState = PresentationState.DicomDefault;
     Initialize();
 }
Esempio n. 10
0
		/// <summary>
		/// Initializes a new instance of <see cref="DicomColorPresentationImage"/>.
		/// </summary>
		/// <param name="frameReference">A <see cref="IFrameReference">reference</see> to the frame from which to construct the image.</param>
		public DicomColorPresentationImage(IFrameReference frameReference)
			: base(frameReference.Frame.Rows,
				   frameReference.Frame.Columns,
				   frameReference.Frame.NormalizedPixelSpacing.Column,
				   frameReference.Frame.NormalizedPixelSpacing.Row,
				   frameReference.Frame.PixelAspectRatio.Column,
				   frameReference.Frame.PixelAspectRatio.Row,
				   frameReference.Frame.GetNormalizedPixelData)
		{
			_frameReference = frameReference;
			base.PresentationState = PresentationState.DicomDefault;
			Initialize();
		}
Esempio n. 11
0
        public VtkTestPresentationImage()
            : base(100, 100, 100)
        {
            var dcf = new DicomFile();

            FillDicomDataSet(dcf.MetaInfo, dcf.DataSet);

            using (var dataSource = new TestDataSource(dcf))
                using (var sop = (ImageSop)Sop.Create(dataSource))
                {
                    _frameReference = sop.Frames[1].CreateTransientReference();
                }
        }
 private void DecompressFrame(IFrameReference frameReference)
 {
     try
     {
         frameReference.Frame.GetNormalizedPixelData();
         _synchronizationContext.Post(OnDecompressedFrame, frameReference);
     }
     catch (Exception e)
     {
         Platform.Log(LogLevel.Error, e);
     }
     finally
     {
         frameReference.Dispose();
     }
 }
		protected virtual void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (_baseFrameReference != null)
				{
					_baseFrameReference.Dispose();
					_baseFrameReference = null;
				}

				if (_overlayDataReference != null)
				{
					_overlayDataReference.FusionOverlayData.Unloaded -= HandleOverlayDataUnloaded;
					_overlayDataReference.Dispose();
					_overlayDataReference = null;
				}
			}
		}
Esempio n. 14
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_baseFrameReference != null)
                {
                    _baseFrameReference.Dispose();
                    _baseFrameReference = null;
                }

                if (_overlayDataReference != null)
                {
                    _overlayDataReference.FusionOverlayData.Unloaded -= HandleOverlayDataUnloaded;
                    _overlayDataReference.Dispose();
                    _overlayDataReference = null;
                }
            }
        }
        private void RetrieveFrame(IFrameReference frameReference)
        {
            try
            {
                Frame frame = frameReference.Frame;
                IStreamingSopFrameData frameData =
                    (IStreamingSopFrameData)frame.ParentImageSop.DataSource.GetFrameData(frame.FrameNumber);
                frameData.RetrievePixelData();

                _framesToDecompress.Add(frameReference);
                _synchronizationContext.Post(OnRetrievedFrame, frameData.LastRetrievePerformanceInfo);
            }
            catch (Exception e)
            {
                frameReference.Dispose();
                Platform.Log(LogLevel.Error, e);
            }
        }
Esempio n. 16
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _fusionOverlayLayer     = null;
                _fusionOverlayComposite = null;

                if (_baseFrameReference != null)
                {
                    _baseFrameReference.Dispose();
                    _baseFrameReference = null;
                }

                if (_overlayFrameDataReference != null)
                {
                    _overlayFrameDataReference.Dispose();
                    _overlayFrameDataReference = null;
                }
            }

            base.Dispose(disposing);
        }
		/// <summary>
		/// Initializes a new instance of <see cref="DicomGrayscalePresentationImage"/>.
		/// </summary>
		/// <param name="frameReference">A <see cref="IFrameReference">reference</see> to the frame from which to construct the image.</param>
		public DicomGrayscalePresentationImage(IFrameReference frameReference)
			: base(frameReference.Frame.Rows,
			       frameReference.Frame.Columns,
			       frameReference.Frame.BitsAllocated,
			       frameReference.Frame.BitsStored,
			       frameReference.Frame.HighBit,
			       frameReference.Frame.PixelRepresentation != 0,
			       frameReference.Frame.PhotometricInterpretation == PhotometricInterpretation.Monochrome1,
			       frameReference.Frame.RescaleSlope,
			       frameReference.Frame.RescaleIntercept,
			       frameReference.Frame.NormalizedPixelSpacing.Column,
			       frameReference.Frame.NormalizedPixelSpacing.Row,
			       frameReference.Frame.PixelAspectRatio.Column,
			       frameReference.Frame.PixelAspectRatio.Row,
			       frameReference.Frame.GetNormalizedPixelData)
		{
			_frameReference = frameReference;
			_dicomVoiLuts = new DicomVoiLuts(this);
			base.PresentationState = PresentationState.DicomDefault;

			if (ImageSop.Modality == "MG")
			{
				// use a special image spatial transform for digital mammography
				CompositeImageGraphic.SpatialTransform = new MammographyImageSpatialTransform(CompositeImageGraphic, Frame.Rows, Frame.Columns, Frame.NormalizedPixelSpacing.Column, Frame.NormalizedPixelSpacing.Row, Frame.PixelAspectRatio.Column, Frame.PixelAspectRatio.Row, Frame.PatientOrientation, Frame.Laterality);
			}

			if (ImageSop.Modality == "PT" && frameReference.Frame.IsSubnormalRescale)
			{
				// some PET images have such a small slope that all stored pixel values map to one single value post-modality LUT
				// we detect this condition here and apply the inverse of the modality LUT as a normalization function for VOI purposes
				// http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/8930b159cb2a8e73?pli=1
				ImageGraphic.NormalizationLut = new NormalizationLutLinear(frameReference.Frame.RescaleSlope, frameReference.Frame.RescaleIntercept);
			}

			Initialize();
		}
        /// <summary>
        /// Initializes a new instance of <see cref="DicomGrayscalePresentationImage"/>.
        /// </summary>
        /// <param name="frameReference">A <see cref="IFrameReference">reference</see> to the frame from which to construct the image.</param>
        public DicomGrayscalePresentationImage(IFrameReference frameReference)
            : base(frameReference.Frame.Rows,
                   frameReference.Frame.Columns,
                   frameReference.Frame.BitsAllocated,
                   frameReference.Frame.BitsStored,
                   frameReference.Frame.HighBit,
                   frameReference.Frame.PixelRepresentation != 0,
                   frameReference.Frame.PhotometricInterpretation == PhotometricInterpretation.Monochrome1,
                   frameReference.Frame.RescaleSlope,
                   frameReference.Frame.RescaleIntercept,
                   frameReference.Frame.NormalizedPixelSpacing.Column,
                   frameReference.Frame.NormalizedPixelSpacing.Row,
                   frameReference.Frame.PixelAspectRatio.Column,
                   frameReference.Frame.PixelAspectRatio.Row,
                   frameReference.Frame.GetNormalizedPixelData)
        {
            _frameReference        = frameReference;
            _dicomVoiLuts          = new DicomVoiLuts(this);
            base.PresentationState = PresentationState.DicomDefault;

            if (ImageSop.Modality == "MG")
            {
                // use a special image spatial transform for digital mammography
                CompositeImageGraphic.SpatialTransform = new MammographyImageSpatialTransform(CompositeImageGraphic, Frame.Rows, Frame.Columns, Frame.NormalizedPixelSpacing.Column, Frame.NormalizedPixelSpacing.Row, Frame.PixelAspectRatio.Column, Frame.PixelAspectRatio.Row, Frame.PatientOrientation, ImageSop.ImageLaterality);
            }

            if (ImageSop.Modality == "PT" && frameReference.Frame.IsSubnormalRescale)
            {
                // some PET images have such a small slope that all stored pixel values map to one single value post-modality LUT
                // we detect this condition here and apply the inverse of the modality LUT as a normalization function for VOI purposes
                // http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/8930b159cb2a8e73?pli=1
                ImageGraphic.NormalizationLut = new NormalizationLutLinear(frameReference.Frame.RescaleSlope, frameReference.Frame.RescaleIntercept);
            }

            Initialize();
        }
Esempio n. 19
0
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		protected DicomColorPresentationImage(DicomColorPresentationImage source, ICloningContext context)
			: base(source, context)
		{
			Frame frame = source.Frame;
			_frameReference = frame.CreateTransientReference();
		}
Esempio n. 20
0
		/// <summary>
		/// Dispose method.  Inheritors should override this method to do any additional cleanup.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			if (disposing && _frameReference != null)
			{
				_frameReference.Dispose();
				_frameReference = null;
			}
			
			base.Dispose(disposing);
		}
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		protected DicomGrayscalePresentationImage(DicomGrayscalePresentationImage source, ICloningContext context)
			: base(source, context)
		{
			Frame frame = source.Frame;
			_frameReference = frame.CreateTransientReference();
			_dicomVoiLuts = new DicomVoiLuts(this);
		}
		internal FusionOverlayFrameData(IFrameReference baseFrame, IFusionOverlayDataReference overlayData)
		{
			_baseFrameReference = baseFrame;
			_overlayDataReference = overlayData;
			_overlayDataReference.FusionOverlayData.Unloaded += HandleOverlayDataUnloaded;
		}
Esempio n. 23
0
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				_fusionOverlayLayer = null;
				_fusionOverlayComposite = null;

				if (_baseFrameReference != null)
				{
					_baseFrameReference.Dispose();
					_baseFrameReference = null;
				}

				if (_overlayFrameDataReference != null)
				{
					_overlayFrameDataReference.Dispose();
					_overlayFrameDataReference = null;
				}
			}

			base.Dispose(disposing);
		}
Esempio n. 24
0
 internal FusionOverlayFrameData(IFrameReference baseFrame, IFusionOverlayDataReference overlayData)
 {
     _baseFrameReference   = baseFrame;
     _overlayDataReference = overlayData;
     _overlayDataReference.FusionOverlayData.Unloaded += HandleOverlayDataUnloaded;
 }