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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 10, 2010 4:40:20 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi,
I am using LT 16 with Visual Basic 6 (NOT .NET)
I am working with 16 bit grayscale TIFF files.
I am able to apply window level on tiff image using WindowLevelFillLUT method.
User is able to adjust the slider bars to adjust the WL.
I want to automate this process.
Rather than adjusting the slider bars, I want to apply best Width and Center values for that image.
This is something like AutoColorLevel function of LEAD Raster Process object.
I read somewhere that this could be achieved by calculating histogram of the image and further processing the data. But I am not much familier with this algorithum.
Please tell me how can I achieve this using lead tools.
 

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, November 10, 2010 4:43:04 AM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Sorry,
A correction needed.
I am using LT 14. I am NOT using LT 16.
 
#3 Posted : Thursday, November 11, 2010 5:41:18 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Amit,
We have a Histogram Equalize function that works with 16-bit grayscale images, but I'm not sure if it does what you want. Please try it and if you need to control the histogram in a different way, give me more details and send me a group of "before" and "after" images that show what you want exactly.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#4 Posted : Thursday, November 11, 2010 8:37:43 PM(UTC)

Amit  
Amit

Groups: Registered
Posts: 101


Hi
Before posting here, I already tried AutoColorLevel, HistoEqualize functions. They are not giving expected result.
I cannot give you "before" and "after" images. For "before" image, you can use any 16 bit grayscale TIF image. About "after" image, it is not something that could be visualized to you in form of sample image because new values of WL has to be CALCULATED. Those should not be applied manually or hardcoded. Still, I will discuss with other members and will definitely try to give you the "before" and "after" images.

Let me explain you the algorithum I am thinking about.
- Calculate the histogram of the image
- Get Min and Max from the histogram.
- Reduce Max by some MAGIC_NUMBER percentage. (If Max is 100 and MAGIC_NUMBER is 3; then reduce the Max by 3%. That will make NewMax = 97.)
- Increase the Min by Max - NewMax (If Min is 10, NewMin will become 13 in our example)
- Now calculate the Width as NewMax - NewMin
- Calculate Level as (Width / 2) + NewMin

Unfortunately, I am not sure about this algorithum. That's why I posted here to know the correct way to calculate and apply best WL values to TIF image using LEAD Tools.

Eventhough, if this is correct algorithum, please let me know how can I implement this algorithum using LEAD Tools 14 in VB6.
 
#5 Posted : Monday, November 15, 2010 5:28:34 AM(UTC)

Travis  
Travis

Groups: Registered, Tech Support
Posts: 207

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

In my response, I'm assuming you are dealing with CT scans where the data of interest is a smaller subset of the entire image data.

Although your TIFF images are 16 bits allocated, there may be a smaller subset of pixels used.  For instance, the actual image maybe 12 or 10 bits.

So to narrow down where the image data is, you can use our LEADRaster.GetMinMaxBits. Prior to calling this function set LEADRaster.UseLUT = false so the function acts on the image data and not the LUT. 
Then call LEADRaster.SetMinMaxBits so other functions will now use this new range of values. 

You now want to call LEADRaster.GetMinMaxVal to find the Minimum and Maximum values in the image.  Here is where you would apply your MAGIC_NUMBER to each value depending on noise in the image.
Once you have your calculated values, set UseLUT back to True, and use LEADRasterProcess.ApplyLinearVOILUT to apply the settings to the image.  Use MaxVal - MinVal for the Width, and divide the Width by two to find the Center. 

This should show the most image data to the user. 
Travis Montgomery
Senior Sales Engineer
LEAD Logo
 
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-2020, Yet Another Forum.NET
This page was generated in 0.254 seconds.