←Select platform

RoiMean Property

Summary
Gets or sets the average value of the pixels in the Region Of Interest.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public double RoiMean { get; set; } 
@property (nonatomic, assign) double roiMean 
public double getRoiMean(); 
public void setRoiMean( 
   double doubleValue 
); 
public: 
property double RoiMean { 
   double get(); 
   void set (    double ); 
} 
RoiMean # get and set (RasterOverlayAttributes) 

Property Value

The average value of the pixels in the Region Of Interest.

Remarks

For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard and Overlay Overview.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Core; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Dicom; 
using Leadtools.Drawing; 
using Leadtools.Controls; 
using Leadtools.Svg; 
 
 
public void GetOverlayImageExample() 
{ 
	RasterCodecs codecs = new RasterCodecs(); 
	// load an image and set an overlay 
	RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "DICOM","image2.dcm"), 0, CodecsLoadByteOrder.BgrOrGray, 1, 1); 
	RasterImage imageOverlay1 = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ulay1.bmp"), 1, CodecsLoadByteOrder.Rgb, 1, 1); 
	RasterImage imageOverlay2 = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ulay1.bmp"), 1, CodecsLoadByteOrder.Rgb, 1, 1); 
	image.SetOverlayImage(0, imageOverlay1, RasterGetSetOverlayImageMode.Copy); 
	image.SetOverlayImage(1, imageOverlay2, RasterGetSetOverlayImageMode.Copy); 
 
	// update the attributes of one of the overlays 
	RasterOverlayAttributes attributes = image.GetOverlayAttributes(0, 
	   RasterGetSetOverlayAttributesFlags.Color | 
	   RasterGetSetOverlayAttributesFlags.Flags | 
	   RasterGetSetOverlayAttributesFlags.Origin | 
	   RasterGetSetOverlayAttributesFlags.BitIndex); 
 
	attributes.Color = new RasterColor(255, 255, 255); 
	attributes.AutoPaint = true; 
	attributes.AutoProcess = true; 
	attributes.Origin = new LeadPoint(5, 5); 
	attributes.BitPosition = image.BitsPerPixel - 1; 
 
	image.UpdateOverlayAttributes( 
	   0, 
	   attributes, 
	   RasterGetSetOverlayAttributesFlags.Color | 
	   RasterGetSetOverlayAttributesFlags.Flags | 
	   RasterGetSetOverlayAttributesFlags.Origin | 
	   RasterGetSetOverlayAttributesFlags.BitIndex); 
 
 
	int count = image.OverlayCount; 
	for (int i = 0; i < count; i++) 
	{ 
		using (RasterImage overlayTest = image.GetOverlayImage(i, RasterGetSetOverlayImageMode.NoCopy)) 
		{ 
			string fileName = string.Format(Path.Combine(LEAD_VARS.ImagesDir, "overlay{0}_copy.bmp"), i); 
			codecs.Save(overlayTest, fileName, RasterImageFormat.Bmp, 1); 
		} 
	} 
 
	image.Dispose(); 
	imageOverlay1.Dispose(); 
	imageOverlay2.Dispose(); 
	codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.16
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.