private void Update() { if (!this.ProbabilityMapEnabled) { return; } IDynamicTeProvider provider = this.ImageViewer.SelectedPresentationImage as IDynamicTeProvider; if (provider == null) { return; } ImageOperationApplicator applicator = new ImageOperationApplicator(this.ImageViewer.SelectedPresentationImage, this); MemorableUndoableCommand command = new MemorableUndoableCommand(applicator); command.Name = "Dynamic Te"; command.BeginState = applicator.CreateMemento(); DynamicTe dynamicTe = provider.DynamicTe; dynamicTe.ProbabilityMapVisible = this.ProbabilityMapVisible; dynamicTe.ApplyProbabilityThreshold((int)this.Threshold, (int)this.Opacity); provider.Draw(); command.EndState = applicator.CreateMemento(); this.ImageViewer.CommandHistory.AddCommand(command); base.NotifyAllPropertiesChanged(); }
public DynamicTePresentationImage( Frame frame, byte[] protonDensityMap, byte[] t2Map, byte[] probabilityMap) : base(frame) { Platform.CheckForNullReference(frame, "imageSop"); _frame = frame; // TODO (Norman): DicomFilteredAnnotationLayoutProvider was made internal. Either need to derive // this class from DicomGrayscalePresentationImage or create a layout provider. //this.AnnotationLayoutProvider = new DicomFilteredAnnotationLayoutProvider(this); AddProbabilityOverlay(); _dynamicTe = new DynamicTe( this.ImageGraphic as GrayscaleImageGraphic, protonDensityMap, t2Map, _probabilityOverlay, probabilityMap); }