/// <summary> /// Cloning constructor. /// </summary> /// <param name="source">The source object from which to clone.</param> /// <param name="context">The cloning context object.</param> protected FusionOverlayCompositeGraphic(FusionOverlayCompositeGraphic source, ICloningContext context) { context.CloneFields(source, this); _overlayFrameDataReference = source._overlayFrameDataReference.Clone(); _overlayFrameDataReference.FusionOverlayFrameData.Unloaded += HandleOverlayFrameDataUnloaded; }
/// <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(); }
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(); }
public FusionOverlayCompositeGraphic(FusionOverlayFrameData overlayFrameData) { _overlayFrameDataReference = overlayFrameData.CreateTransientReference(); _overlayFrameDataReference.FusionOverlayFrameData.Unloaded += HandleOverlayFrameDataUnloaded; _voiLutManagerProxy = new VoiLutManagerProxy(); _colorMapManagerProxy = new ColorMapManagerProxy(); // install an initial VOI window if one is available in the overlay headers var initialVoiWindow = CollectionUtils.FirstElement(overlayFrameData.OverlayData.VoiWindows); if (initialVoiWindow != null) VoiLutManager.InstallVoiLut(new BasicVoiLutLinear(initialVoiWindow.Width, initialVoiWindow.Center)); }
protected override void Dispose(bool disposing) { if (disposing) { if (_overlayFrameData != null) { _overlayFrameData.Dispose(); _overlayFrameData = null; } } base.Dispose(disposing); }
public FusionOverlayCompositeGraphic(FusionOverlayFrameData overlayFrameData) { _overlayFrameDataReference = overlayFrameData.CreateTransientReference(); _overlayFrameDataReference.FusionOverlayFrameData.Unloaded += HandleOverlayFrameDataUnloaded; _voiLutManagerProxy = new VoiLutManagerProxy(); _colorMapManagerProxy = new ColorMapManagerProxy(); // install an initial VOI window if one is available in the overlay headers var initialVoiWindow = CollectionUtils.FirstElement(overlayFrameData.OverlayData.VoiWindows); if (initialVoiWindow != null) { VoiLutManager.InstallVoiLut(new BasicVoiLutLinear(initialVoiWindow.Width, initialVoiWindow.Center)); } }
public FusionOverlayImageGraphic(FusionOverlayFrameData fusionOverlayFrameData) : base(fusionOverlayFrameData._overlayFrameParams.Rows, fusionOverlayFrameData._overlayFrameParams.Columns, fusionOverlayFrameData._overlayFrameParams.BitsAllocated, fusionOverlayFrameData._overlayFrameParams.BitsStored, fusionOverlayFrameData._overlayFrameParams.HighBit, fusionOverlayFrameData._overlayFrameParams.IsSigned, fusionOverlayFrameData._overlayFrameParams.IsInverted, fusionOverlayFrameData._overlayFrameParams.RescaleSlope, fusionOverlayFrameData._overlayFrameParams.RescaleIntercept, fusionOverlayFrameData.GetPixelData) { // this image graphic needs to keep a transient reference on the slice, otherwise it could get disposed before we do! _overlayFrameData = fusionOverlayFrameData.CreateTransientReference(); if (fusionOverlayFrameData.OverlayData.Modality == @"PT" && RescaleSlope < 1.0 / (1 << BitsStored)) { // 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 NormalizationLut = new InvertedLinearLut(RescaleSlope, RescaleIntercept); } }
protected override void Dispose(bool disposing) { if (disposing) { _overlayImageGraphic = null; _voiLutManagerProxy = null; _colorMapManagerProxy = null; if (_overlayFrameDataReference != null) { _overlayFrameDataReference.FusionOverlayFrameData.Unloaded -= HandleOverlayFrameDataUnloaded; _overlayFrameDataReference.Dispose(); _overlayFrameDataReference = null; } } base.Dispose(disposing); }
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> /// Cloning constructor. /// </summary> /// <param name="source">The source object from which to clone.</param> /// <param name="context">The cloning context object.</param> private FusionOverlayImageGraphic(FusionOverlayImageGraphic source, ICloningContext context) : base(source, context) { context.CloneFields(source, this); _overlayFrameData = source._overlayFrameData.Clone(); }
public FusionOverlayImageGraphic(FusionOverlayFrameData fusionOverlayFrameData) : base(fusionOverlayFrameData._overlayFrameParams.Rows, fusionOverlayFrameData._overlayFrameParams.Columns, fusionOverlayFrameData._overlayFrameParams.BitsAllocated, fusionOverlayFrameData._overlayFrameParams.BitsStored, fusionOverlayFrameData._overlayFrameParams.HighBit, fusionOverlayFrameData._overlayFrameParams.IsSigned, fusionOverlayFrameData._overlayFrameParams.IsInverted, fusionOverlayFrameData._overlayFrameParams.RescaleSlope, fusionOverlayFrameData._overlayFrameParams.RescaleIntercept, fusionOverlayFrameData.GetPixelData) { // this image graphic needs to keep a transient reference on the slice, otherwise it could get disposed before we do! _overlayFrameData = fusionOverlayFrameData.CreateTransientReference(); if (fusionOverlayFrameData.OverlayData.Modality == @"PT" && RescaleSlope < 1.0/(1 << BitsStored)) { // 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 NormalizationLut = new InvertedLinearLut(RescaleSlope, RescaleIntercept); } }