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 : Monday, July 27, 2009 11:43:42 PM(UTC)

Andi  
Andi

Groups: Registered
Posts: 5


Hi,

ich have to convert some medical images (grayscale images with signed pixelvalues) to unsigned images. Than doing some imageprocessing stuff and finally shifting everything back. There is also an WindowLevel- Lookuptable included.
To convert the signed data to unsigned i use the method LBitmap::ShiftMinimumToZero(puShiftAmount) and i also adjust the window/level lookuptable by shifting the level by the calculated shift amount. This works fine. But i have problems to shift everything back to get the image like it was before.
 I tried to use the method LBitmap::ShiftZeroToNegative(nShiftAmount, nMinInput, nMaxInput, nMinOutput, nMaxOutput). But i dont get the results i want and i have some questions. Are only the zero values are shifted to negative by this method or all values are decreased by the shiftamout? And i dont understand all the parameter properly. What is the the diference between the nMinInput, nMaxInput parameter and  the nMinOutput, nMaxOutput parameter? As long as i understand it the nMinInput, nMaxInput parameter are only for the BITMAPHANDLE struct and the other two parameter for the values itself. Is this true? The help files doesnt help me in this case so can somebody please explain the parameter?  

Thanks in advance
Andi


 

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 : Tuesday, July 28, 2009 7:52:58 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

Andi,
All values should be shifted using LBitmap::ShiftZeroToNegative.

If the new values after shifting do not go below nMinOutput, the shift amount will be uniform across all pixels. The input Min and Max values should be obtained from the image itself before you call ShiftZeroToNegative.

The  output Min and Max values can be obtained from the original image before it was converted to unsigned (before calling ShiftMinimumToZero).

 
#3 Posted : Wednesday, July 29, 2009 2:18:44 AM(UTC)

Andi  
Andi

Groups: Registered
Posts: 5


Thank you for your reply. Now i got it. If it is like you described the example code for ShiftZeroToNegative in the Leadtools Class libary help file is wrong.
For example i have an 16bit grayscale image with a grayvaluerange from -1000 to 3000. I call "ShiftMinimumToZero" to shift the data and get a shiftamount of 1000. The new grayvalues are from 0 to 4000. To shift it back i call ShiftZeroToNegative and like i understand your reply it should look like this:
ShiftZeroToNegative(1000, 0 ,4000, -1000, 3000)
The examplecode in the help file looks like this:
nRet = LeadBitmap.ShiftZeroToNegative( nShiftAmount, -32767, 32766, 0, 65535); 
which cant be work in my eyes.

On the other hand i tested the code and i get a strange result when i call the ShiftZeroToNegative method. I call GetMinMaxVal and get  1000 for the minimum value and 3000 for the maximum value. The signed flag in the Bitmaphandle is set to signed.

Did i understand all the parameter correct? What i am doing wrong? By the way i use LeadTools Version 14.5

Thanks
Andi
 





 
#4 Posted : Thursday, July 30, 2009 5:12:15 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

Andi,
I want to investigate this further. Could you please send an email to support@leadtools.com from a valid email address and mention this forum post in it.
Also, if you have a toolkit serial number, please include it in the email (do NOT post it here).
 
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.073 seconds.