Пример #1
0
        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();
        }
Пример #2
0
        void IUndoableOperation <IPresentationImage> .Apply(IPresentationImage image)
        {
            IDynamicTeProvider provider = image as IDynamicTeProvider;

            if (provider != null)
            {
                provider.DynamicTe.Te = this.SelectedDynamicTeProvider.DynamicTe.Te;
            }
        }
Пример #3
0
        IMemorable IUndoableOperation <IPresentationImage> .GetOriginator(IPresentationImage image)
        {
            IDynamicTeProvider provider = image as IDynamicTeProvider;

            if (provider == null)
            {
                return(null);
            }

            return(provider as IMemorable);
        }
Пример #4
0
        public string GetAnnotationText(IPresentationImage presentationImage)
        {
            if (presentationImage == null)
            {
                return(string.Empty);
            }

            IDynamicTeProvider teProvider = presentationImage as IDynamicTeProvider;

            if (teProvider == null)
            {
                return(string.Empty);
            }

            string annotationText = String.Format("Echo Time: {0:F2}", teProvider.DynamicTe.Te);

            return(annotationText);
        }
Пример #5
0
        /// <summary>
        /// Called by the framework as the mouse moves while the assigned mouse button
        /// is pressed.
        /// </summary>
        /// <param name="e">Mouse event args</param>
        /// <returns>True if the event was handled, false otherwise</returns>
        public override bool Track(IMouseInformation mouseInformation)
        {
            base.Track(mouseInformation);

            IDynamicTeProvider dynamicTeProvider = this.SelectedPresentationImage as IDynamicTeProvider;

            if (dynamicTeProvider == null)
            {
                return(false);
            }

            double timeDelta = this.DeltaX * 0.25;

            dynamicTeProvider.DynamicTe.Te += timeDelta;
            dynamicTeProvider.Draw();

            return(true);
        }