Leadtools.Windows.Media.Effects Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
MultiscaleEnhancementCommandBitmapEffect Class
See Also  Members   Example 
Leadtools.Windows.Media.Effects.Core Namespace : MultiscaleEnhancementCommandBitmapEffect Class





Enhances an image’s contrast, edges, and density range for use in Computed Radiography (CR), in a way that all relevant image features are rendered with an appropriate level of visibility.

Syntax

Visual Basic (Declaration) 
Public Class MultiscaleEnhancementCommandBitmapEffect 
   Inherits RasterCommandBitmapEffect
Visual Basic (Usage)Copy Code
Dim instance As MultiscaleEnhancementCommandBitmapEffect
C# 
public class MultiscaleEnhancementCommandBitmapEffect : RasterCommandBitmapEffect 
C++/CLI 
public ref class MultiscaleEnhancementCommandBitmapEffect : public RasterCommandBitmapEffect 
XAML Property Element Usage 

MultiscaleEnhancementCommandBitmapEffect ...

XAML Property Element Usage 

MultiscaleEnhancementCommandBitmapEffect ...

Example

Run the MultiscaleEnhancementCommandBitmapEffect on an image.

Visual BasicCopy Code
Public Sub MultiscaleEnhancementCommandBitmapEffectExample(ByVal element As FrameworkElement)
   Dim effect As MultiscaleEnhancementCommandBitmapEffect = New MultiscaleEnhancementCommandBitmapEffect()
   effect.Contrast = 1500
   effect.EdgeLevels = 3
   effect.EdgeCoefficient = 5
   effect.LatitudeLevels = 5
   effect.LatitudeCoefficient = 140
   effect.Type = MultiscaleEnhancementCommandBitmapEffectsType.Gaussian
   effect.Flags = MultiscaleEnhancementCommandBitmapEffectsFlags.EdgeEnhancement
   element.BitmapEffect = effect

   Dim storyboard As Storyboard = New Storyboard()

   Dim animation1 As Int32Animation = New Int32Animation()
   animation1.From = 1
   animation1.To = 2000
   animation1.Duration = New Duration(TimeSpan.Parse("0:0:5"))
   animation1.RepeatBehavior = RepeatBehavior.Forever
   animation1.AutoReverse = True

   storyboard.SetTargetName(animation1, "AnimatedBitmapEffect")
   storyboard.SetTargetProperty(animation1, New PropertyPath(MultiscaleEnhancementCommandBitmapEffect.EdgeCoefficientProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation1)

   Dim animation2 As Int32Animation = New Int32Animation()
   animation2.From = 0
   animation2.To = 5000
   animation2.Duration = New Duration(TimeSpan.Parse("0:0:5"))
   animation2.RepeatBehavior = RepeatBehavior.Forever
   animation2.AutoReverse = True

   storyboard.SetTargetName(animation2, "AnimatedBitmapEffect")
   storyboard.SetTargetProperty(animation2, New PropertyPath(MultiscaleEnhancementCommandBitmapEffect.ContrastProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation2)

   storyboard.Begin(element)
End Sub
C#Copy Code
public void MultiscaleEnhancementCommandBitmapEffectExample(FrameworkElement element) 

   MultiscaleEnhancementCommandBitmapEffect effect = new MultiscaleEnhancementCommandBitmapEffect(); 
   effect.Contrast = 1500; 
   effect.EdgeLevels = 3; 
   effect.EdgeCoefficient = 5; 
   effect.LatitudeLevels = 5; 
   effect.LatitudeCoefficient = 140; 
   effect.Type = MultiscaleEnhancementCommandBitmapEffectsType.Gaussian; 
   effect.Flags = MultiscaleEnhancementCommandBitmapEffectsFlags.EdgeEnhancement; 
   element.BitmapEffect = effect; 
 
   Storyboard storyboard = new Storyboard(); 
 
   Int32Animation animation1 = new Int32Animation(); 
   animation1.From = 1; 
   animation1.To = 2000; 
   animation1.Duration = new Duration(TimeSpan.Parse("0:0:5")); 
   animation1.RepeatBehavior = RepeatBehavior.Forever; 
   animation1.AutoReverse = true; 
 
   Storyboard.SetTargetName(animation1, "AnimatedBitmapEffect"); 
   Storyboard.SetTargetProperty(animation1, new PropertyPath(MultiscaleEnhancementCommandBitmapEffect.EdgeCoefficientProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation1); 
 
   Int32Animation animation2 = new Int32Animation(); 
   animation2.From = 0; 
   animation2.To = 5000; 
   animation2.Duration = new Duration(TimeSpan.Parse("0:0:5")); 
   animation2.RepeatBehavior = RepeatBehavior.Forever; 
   animation2.AutoReverse = true; 
 
   Storyboard.SetTargetName(animation2, "AnimatedBitmapEffect"); 
   Storyboard.SetTargetProperty(animation2, new PropertyPath(MultiscaleEnhancementCommandBitmapEffect.ContrastProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation2); 
 
   storyboard.Begin(element); 
}
XAMLCopy Code
<Page Title="CSAnimateEffect" Height="391" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:lteffects="clr-namespace:Leadtools.Windows.Media.Effects.Core;assembly=Leadtools.Windows.Media.Effects"> 
  <Grid> 
    <Image Margin="10,10,10,10" HorizontalAlignment="Center" VerticalAlignment="Center" Source="C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 16\Images\slave.jpg"> 
      <Image.BitmapEffect> 
        <lteffects:MultiscaleEnhancementCommandBitmapEffect x:Name="AnimatedBitmapEffect" Flags="EdgeEnhancement" Contrast="5000" EdgeCoefficient="170" Type="Gaussian" /> 
      </Image.BitmapEffect> 
      <Image.Triggers> 
        <EventTrigger RoutedEvent="Image.Loaded"> 
          <BeginStoryboard> 
            <Storyboard> 
              <Int32Animation Storyboard.TargetName="AnimatedBitmapEffect" Storyboard.TargetProperty="EdgeCoefficient" From="1" To="2000" Duration="0:0:5" RepeatBehavior="Forever" AutoReverse="true" /> 
              <Int32Animation Storyboard.TargetName="AnimatedBitmapEffect" Storyboard.TargetProperty="Contrast" From="0" To="5000" Duration="0:0:5" RepeatBehavior="Forever" AutoReverse="true" /> 
            </Storyboard> 
          </BeginStoryboard> 
        </EventTrigger> 
      </Image.Triggers> 
    </Image> 
  </Grid> 
</Page>

Remarks

  • The command wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).
  • In multi-scale enhancement, the image is decomposed into components or levels. Those components or levels that contain details will be enhanced separately from other components or levels.
  • This will improve the visualization for the subtle image features without the risk of losing information of other features.
  • To find the number of levels in any image follow this equation:
  • MaximumLevels = ceil( log( max(pimage->Width, pimage->Height)) / log(2));
  • The command will consider values larger than 10000 for contrast as 10000. If the user used a conttrast of 0, then image contrast will not be improved.
  • Best results are obtained if contrast is in the range of 15 ~ 30. The larger the value the stronger the enhancement will be. Any stronger enhancement than 30 will reveal noise and no new enhancement will be noticed.
  • The user can further enhance the image withT:Leadtools.Windows.Media.Effects.Core.MultiscaleEnhancementCommandBitmapEffectsFlagsEdgeEnhancement) and/or
  • latitude reduction T:Leadtools.Windows.Media.Effects.Core.MultiscaleEnhancementCommandBitmapEffectsFlags%.LatitudeReduction)
  • The edge levels, edge coefficient, latitude levels and latitude coefficient values are available for advanced users. Using -1 would give the maximum enhancements.
  • Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Freezable
                System.Windows.Media.Animation.Animatable
                   System.Windows.Media.Effects.BitmapEffect
                      Leadtools.Windows.Media.Effects.RasterCommandBitmapEffect
                         Leadtools.Windows.Media.Effects.Core.MultiscaleEnhancementCommandBitmapEffect

    Requirements

    Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, Windows Server 2003 family, Windows Server 2008 family

    See Also