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



Last Go to last post Unread Go to first unread post
#1 Posted : Friday, September 25, 2020 11:09:32 AM(UTC)


Groups: Registered
Posts: 8

Thanks: 2 times

I have an image with a scale defined within the image, I want to be able to set that scale so that all measurement annotations use it.

So far I use an AnnPolyRulerObject to measure where the scale is on the image:

I then use the calibrate method to tell the ruler how long the distance should be and what units to measure it in:

I think I found a bug here with the AnnPolyRulerObject, it does not update it's display on screen after calling Calibrate and setting a new length and unit. You have to move the ruler to get it to re-measure before it'll update to the new values.

What I would like to do is store this scale so that when I draw another ruler over a similar distance it will give a similar measurement rather than using the default measurement scale. Ideally I'd be able to apply that scale to all measuring items.

I'm also open to other ways of achieving this, if there's a more supported method for calibrating the scale of annotations possibly? I have had a look at AnnUnitConverter to see if that's how to set the scale but I'm not sure it is.


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 : Monday, September 28, 2020 4:05:03 AM(UTC)


Groups: Registered
Posts: 8

Thanks: 2 times

It's looking like I'll need to have something to remember the calibration scale that gets set on the AnnPolyRulerObject when I call Calibrate to set the correct measurement for the distance, then when any measuring annotation is created it has it's CalibrationScale property set to the same. I'll probably need to create my own annotation objects so I can set this during the Create method.
#3 Posted : Tuesday, September 29, 2020 11:09:42 AM(UTC)


Groups: Manager, Tech Support, Administrators
Posts: 218

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

In order to update the display, you should call AnnAutomation.Invalidate

Regarding the Calibration scale, you need to call Calibrate from the AnnContainer's Mapper in order to update the calibration scale for all of the annotations. If you just want to calibrate a single annotation - you should call Calibrate on that one object. More info can be found here:

This method will use the parameters to calculate a new value for CalibrationScale. This value is used afterwards by all the existing ruler and new ruler objects created in this container.

The value of destinationUnit is set into CalibrationUnit and will be used as the default unit for all new ruler objects created in this container after this method has been called.

Calibrating a ruler means assigning a specific length to it. For example, on a digital X-ray of a hand, you may draw an annotation ruler object along one of the fingers. You know that this distance is supposed to be exactly 6.5 cm. Using the new calibration functionality you can calibrate this ruler, all existing rulers, and all newly created rulers so that they would precisely measure this distance to be 6.5 cm. This is accomplished by first drawing a ruler on the container till it matches exactly the length of the finger - ignoring the values shown - then using Calibrate as shown in the example.

Use AnnPolyRulerObject.Calibrate to set individual calibration values for a single ruler.

Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

thanks 1 user thanked Hadi for this useful post.
losh on 9/29/2020(UTC)
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.071 seconds.