Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, June 11, 2015 10:16:01 PM(UTC)
anilsharma150

Groups: Registered
Posts: 16


Dear sir i'm using Leadtools 18 Trial version.
How to calculate circle,Rectangle & Eclipse Annotation area in MM unit
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, June 14, 2015 8:28:34 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

If you still haven't bought LEADTOOLS, you should not continue with v18 evaluation but download v19 because that's the version you are likely to purchase.
If you mean by "Area" the pixel count of the annotation object, you can use the AnnObject.GetArea() method to get the pixel count of the annotation object. For more information about this method, refer to the following online help topic:
https://www.leadtools.com/help/leadtools/v19/dh/an/leadtools.annotations~leadtools.annotations.annobject~getarea.html

The following code shows how you can get the area of each annotation object:
+-----------------------------+
if (_medicalViewer != null)
{
foreach (MedicalViewerMultiCell cell in _medicalViewer.Cells)
{
AnnContainer container = cell.GetAnnotationContainer();
 
foreach (AnnObject AnnObj in container.Children)
{
//The GetArea method gets the pixel count
var pixels = AnnObj.GetArea();
//Get the DPI of the image
var dpi = cell.Image.XResolution;

var mmArea = (pixels * 25.4) / dpi;

MessageBox.Show("The Area in MM of " + AnnObj.GetType().ToString() + " In cell index \"" + GetCellIndex(cell).ToString() + "\" = " + mmArea.ToString());  
                         cell.ConvertAnnotationToRegion(RasterRegionCombineMode.And, true);  
}
}
}
+-----------------------------+

If this is not what you need, please send me more details about your requirements.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Sunday, June 14, 2015 9:32:50 PM(UTC)
anilsharma150

Groups: Registered
Posts: 16


Thx for your replay.

Sir i need Area calculation in centimeter square (CM2) or millimeter square (MM2). Image attached like calculation
 
#4 Posted : Sunday, June 14, 2015 9:35:20 PM(UTC)
anilsharma150

Groups: Registered
Posts: 16


Image Attached
File Attachment(s):
untitled.zip (178kb) downloaded 48 time(s).
 
#5 Posted : Tuesday, June 16, 2015 6:52:12 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

If you have the horizontal and vertical (x & y) DPI of the image, you can use the following conversions:
double dotsPerMMx = DPIx / 25.4;
double dotsPerMMy = DPIy / 25.4;
double areaInMMSquare = areaInPixels / (dotsPerMMx * dotsPerMMy);
This means if the pixel count in the area is 800, and the image has 20 dots per mm (both x and y), the same area in square millimeters would be:
800 / (20 * 20) = 800/400 = 2 mm^2

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.119 seconds.