Ejemplo n.º 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();
        }
Ejemplo n.º 2
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);
        }