LEADTOOLS WCF Image Processing (Leadtools.Services.ImageProcessing.ServiceContracts assembly)

StatisticsInformation Method

Show in webframe
Example 





A System.Runtime.Serialization.DataContractAttribute containing the data that will be used in this StatisticsInformation operation.
Returns statistical information about the image.
Syntax
[FaultContractAttribute(DetailType=Leadtools.Services.Raster.FaultContracts.RasterFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
[OperationContractAttribute("StatisticsInformation")]
StatisticsInformationResponse StatisticsInformation( 
   StatisticsInformationRequest request
)
'Declaration
 
<FaultContractAttribute(DetailType=Leadtools.Services.Raster.FaultContracts.RasterFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=False)>
<OperationContractAttribute("StatisticsInformation")>
Function StatisticsInformation( _
   ByVal request As StatisticsInformationRequest _
) As StatisticsInformationResponse
'Usage
 
Dim instance As IImageProcessingService
Dim request As StatisticsInformationRequest
Dim value As StatisticsInformationResponse
 
value = instance.StatisticsInformation(request)

            

            
[FaultContractAttribute(DetailType=Leadtools.Services.Raster.FaultContracts.RasterFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
[OperationContractAttribute("StatisticsInformation")]
StatisticsInformationResponse^ StatisticsInformation( 
   StatisticsInformationRequest^ request
) 

Parameters

request
A System.Runtime.Serialization.DataContractAttribute containing the data that will be used in this StatisticsInformation operation.

Return Value

A System.Runtime.Serialization.DataContractAttribute containing the modified image resulting from the StatisticsInformation operation.
Remarks
Example
Copy Code  
Imports Leadtools.Services
Imports Leadtools.Services.datacontracts._2009._01
Imports Leadtools.Services.raster.datacontracts._2009._01
Imports Leadtools.Services.ImageProcessing.datacontracts._2009._01

Public Sub StatisticsInformationExample()
   Dim client As ImageProcessingServiceClient = New ImageProcessingServiceClient()
   Dim imageService As IImageProcessingService = TryCast(client, IImageProcessingService)

   Dim sourceBinaryData As RawBinaryData = New RawBinaryData()
   sourceBinaryData.Data = File.ReadAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp"))

   Dim convertOptions As RasterConvertOptions = New RasterConvertOptions()

   convertOptions.Source = sourceBinaryData
   convertOptions.Destination = Nothing
   convertOptions.Format = RasterImageFormat.Bmp
   convertOptions.FirstPage = 1
   convertOptions.LastPage = 1
   convertOptions.BitsPerPixel = 24
   convertOptions.QualityFactor = 2

   Dim request As StatisticsInformationRequest = New StatisticsInformationRequest()
   request.ConvertOptions = convertOptions
   request.Channel = RasterColorChannel.Master
   request.Start = 0
   request.End = 255

   Dim response As StatisticsInformationResponse = imageService.StatisticsInformation(request)

   Console.WriteLine(String.Format("Minimum = : {0}", response.Minimum))
   Console.WriteLine(String.Format("Maximum = {0}", response.Maximum))
   Console.WriteLine(String.Format("Mean = {0}", response.Mean))
   Console.WriteLine(String.Format("Median = {0}", response.Median))
   Console.WriteLine(String.Format("Percent = {0}", response.Percent))
   Console.WriteLine(String.Format("StandardDeviation = {0}", response.StandardDeviation))
   Console.WriteLine(String.Format("TotalPixelCount = {0}", response.TotalPixelCount))

   client.Close()
End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools.Services;
using leadtools.services.datacontracts._2009._01;
using leadtools.services.raster.datacontracts._2009._01;
using leadtools.services.imageprocessing.datacontracts._2009._01;

public void StatisticsInformationExample()
{
   ImageProcessingServiceClient client = new ImageProcessingServiceClient();
   IImageProcessingService imageService = client as IImageProcessingService;

   RawBinaryData sourceBinaryData = new RawBinaryData();
   sourceBinaryData.Data = File.ReadAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp"));

   RasterConvertOptions convertOptions = new RasterConvertOptions();

   convertOptions.Source = sourceBinaryData;
   convertOptions.Destination = null;
   convertOptions.Format = RasterImageFormat.Bmp;
   convertOptions.FirstPage = 1;
   convertOptions.LastPage = 1;
   convertOptions.BitsPerPixel = 24;
   convertOptions.QualityFactor = 2;

   StatisticsInformationRequest request = new StatisticsInformationRequest();
   request.ConvertOptions = convertOptions;
   request.Channel = RasterColorChannel.Master;
   request.Start = 0;
   request.End = 255;

   StatisticsInformationResponse response = imageService.StatisticsInformation(request);

   Console.WriteLine(string.Format("Minimum = : {0}", response.Minimum));
   Console.WriteLine(string.Format("Maximum = {0}", response.Maximum));
   Console.WriteLine(string.Format("Mean = {0}", response.Mean));
   Console.WriteLine(string.Format("Median = {0}", response.Median));
   Console.WriteLine(string.Format("Percent = {0}", response.Percent));
   Console.WriteLine(string.Format("StandardDeviation = {0}", response.StandardDeviation));
   Console.WriteLine(string.Format("TotalPixelCount = {0}", response.TotalPixelCount));

   client.Close();
}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Requirements

Target Platforms

See Also

Reference

IImageProcessingService Interface
IImageProcessingService Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Applications developed with LEADTOOLS WCF components require runtime licenses. Server licensing is required for applications on a server. For more information, refer to: Imaging Pro/Document/Medical