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, October 22, 2009 7:40:50 PM(UTC)
omarelgazzar11

Groups: Registered
Posts: 3


I'm trying to apply modality, voi, presentation LUT using leadtools v.13 using Delphi.
I'm using the LevelLut[i] property to set the color of each gray level in the bitmap.
The problem is that the LUT data are 16 bits and I want to convert this 16 bits value (0-635536) to TColor (RGB).
I tried to scale the 16-bits value to 8-bits (gray = 0-256) and using
leadimage1.LevelLut[i]:=RGB(gray,gray,gray);
but the output result is not correct.
Can you help me in this regard?
Thanks,


 

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, October 25, 2009 4:33:20 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

It appears you're using the LEADTOOLS VCL components, is this correct?
In any case, the LevelLut entries are regular 24-bit color values. The index of the array property corresponds to the gray level.

This means if you have a 16-bit grayscale image, the entries will be from LevelLut[0] to LevelLut[65535]. You can assign any color to each level as desired.

For example, to display the pure black pixels as red, you assign RGB(255, 0, 0) to LevelLut[0].
As another example, to display pure black pixels as green on the screen, you assign RGB(0, 255, 0) to LevelLut[65535].

If you want to display grayscales as similar-looking gray, you assign the following:
LevelLut[n] := RGB(x, x, x), where n ranges from 0 to 65535 and x = n/256.
 
#3 Posted : Monday, October 26, 2009 3:33:43 AM(UTC)
omarelgazzar11

Groups: Registered
Posts: 3


Dear Mr.Basel,

Thank you for your hint...

What if the image is signed (e.g 12 bits in 16 bits image that has values from -2048 to +2047)?. In this case, I cannot pass a -ve index corresponding to -ve grayscale level to the function LevelLut[n] when n<0.
How can I solve this problem?.

thanks,
 
#4 Posted : Monday, October 26, 2009 5:44:23 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

You can check the IsSigned property and if it's true, use the ConvertSignedToUnsigned method to convert the image values to the non-negative range.

 
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.079 seconds.