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 : Wednesday, May 29, 2024 11:19:58 AM(UTC)

lehuy  
lehuy

Groups: Registered
Posts: 16


I want to make an ROI tool like this, what is the solution?
I want to save it as annotation?
[img]https://drive.google.com/file/d/1EkkLIIxPgi2l2QYncJ26yJ58-rzvbTc0/view?usp=sharing[/img]
 

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 : Wednesday, May 29, 2024 3:47:27 PM(UTC)
Tommy Thyen

Groups: Registered, Manager, Tech Support, Administrators
Posts: 16


Hello Lehuy,

You can extend our automated annotations framework to create an ROI tool as pictured. Here is an example of one that I made:
customannotation.png

I'd recommend starting from one of our annotation tutorials to better understand the underlying framework:
https://www.leadtools.co...notations-on-images.html

The label with ROI information is simply an AnnTextObject (https://www.leadtools.com/help/sdk/dh/ac/anntextobject.html). When the user finishes drawing the region, the AutomationInteractiveMode_WorkCompleted(https://www.leadtools.com/help/sdk/dh/c/imageviewerinteractivemode-workcompleted.html) event fires, signaling for us to obtain the data, which we then pass to the text object and finally insert said text object into the AnnContainer (https://www.leadtools.com/help/sdk/dh/ac/anncontainer.html) to render it on screen.

In the WorkCompleted event handler, obtain pixel information based on the selected region and create your AnnTextObject with the necessary values:
code1.png

Then, you can use our AnnCodecs (https://www.leadtools.com/help/sdk/dh/ac/anncodecs.html) class to save the annotation data to XML/string for storage and re-loading in the future.

This is just one of the many ways you can achieve this functionality with our SDK. Another approach would use the ImageViewerAddRegionInteractiveMode (https://www.leadtools.com/help/sdk/v23/dh/c/imagevieweraddregioninteractivemode.html) to cut out some of the code and work directly with a Region on a RasterImage.

Please let us know if you have any questions!
Tommy Thyen
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Thursday, May 30, 2024 11:42:48 PM(UTC)

lehuy  
lehuy

Groups: Registered
Posts: 16


Hello Tommy Thyen,
Let me ask why for image3.dcm in Leadtools image, in the parameter image.BitsPerPixel = 16, but for comand.Start and comand.End outside the range 0-255, it says "Invalid parameter passed" even though it is an image 16bit and I use Leadtool v19 https://drive.google.com...iMk5lt2/view?usp=sharing

Edited by user Friday, May 31, 2024 10:39:35 AM(UTC)  | Reason: Not specified

 
#4 Posted : Friday, May 31, 2024 3:50:25 PM(UTC)
Matthew Bresson

Groups: Registered, Tech Support, Administrators
Posts: 105

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

Hello Lehuy,

Since you are reaching out with a question in regards to LEADTOOLS v19, one of our Support Agents is going to reach out to you via email. We need to gather some private licensing information and will do so via email. If that email address is not correct, please update it and let me know so I can resend the email.

Thanks,
Matt Bresson
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS
 
#5 Posted : Thursday, June 6, 2024 9:49:20 AM(UTC)
Matthew Bresson

Groups: Registered, Tech Support, Administrators
Posts: 105

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

Hello Lehuy,

The reason the command wasn't running on the image was because by default this DICOM image will load with in HU Units. In order to use pixel dependent functions you would need to load or convert these values to Presentation Units.

The simplest way to accomplish this would be to load the image with the Modality LUT transform applied by using the "DicomGetImageFlags.AutoApplyModalityLut" flag in the GetImage() or GetImages() function that you are using to load the image. For example I used the below call when retrieving the image, and was able to use the StatisticsInformationCommand command without any issues:

RasterImage image = ds.GetImage(null, 0, 16, RasterByteOrder.Gray, DicomGetImageFlags.AutoApplyModalityLut);

You can find additional information on working with DICOM LUT in our documentation:
https://www.leadtools.co...king-with-dicom-lut.html

Thanks,
Matt Bresson
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS
 
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.078 seconds.