LEADTOOLS Support
Document
Document SDK Questions
How to use Dicom Annotation area calculation
#1
Posted
:
Thursday, June 11, 2015 10:16:01 PM(UTC)
Groups: Registered
Posts: 16
Dear sir i'm using Leadtools 18 Trial version.
How to calculate circle,Rectangle & Eclipse Annotation area in MM unit
#2
Posted
:
Sunday, June 14, 2015 8:28:34 AM(UTC)
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)
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)
Groups: Registered
Posts: 16
#5
Posted
:
Tuesday, June 16, 2015 6:52:12 AM(UTC)
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
LEADTOOLS Support
Document
Document SDK Questions
How to use Dicom Annotation area calculation
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.