This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, June 6, 2011 5:03:24 AM(UTC)
Groups: Registered
Posts: 101
Hi,
I am using LT 14.5 with VB6.
I am applying WL to 16 bit grayscale TIF image.
While calling ApplyLinearVOILUT function, I need to set the VOI_LUT_REVERSE_ORDER flag of method if image is inverted.
Right now, I am handling this using variable.
Is there any way to handle this without variable ?
How should I know whether the image is inverted or not ?
Following is the download link for sample project.
<link removed by moderator>
PLEASE DELETE THE LINK AFTER YOU DOWNLOAD THE FILE.
#2
Posted
:
Monday, June 6, 2011 6:11:30 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Amit,
Deciding when to use the flag depends on your images and their source.
Usually, if the image was from a DICOM dataset created by a certain modality, the dataset itself would give you an indication that the minimum grayscale value is intended to be displayed as white after any VOI gray scale transformations have been performed by having the photometric interpretation of the image as "MONOCHROME1".
Since your image is not a DICOM data set but a TIFF file, you will need to know whether the source intended it to be reversed or not.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, June 6, 2011 9:39:58 PM(UTC)
Groups: Registered
Posts: 101
Hi,
Following are the steps :-
1) Source provides Monochrome1 image.
2) I invert this image before it is presented to the user. Image becomes Monochrome2
3) User further MAY invert the image or use any other processing including WL.
If user invert the image in step 3 and apply the WL, image reverts back to positive.
To avoid this, i am using "blnInverted" variable (please refer my code in sample application attached in earlier post) to keep track of invert action. But variable do not work if inverted image is saved and application re-opened.
I was looking for some property or something that tells me whether the image is Monochrome 1 or 2.
Is there any such property/method ?
Also please advice whether LEADRasterView1.Raster.IsGrayscale is useful or not ?
#4
Posted
:
Tuesday, June 7, 2011 5:18:59 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Amit,
If the TIFF is loaded correctly into LEADTOOLS, you can check IsGrayscale, and it should return GRAY_ORDEREDINVERSE when white is zero and black is maximum value.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Tuesday, June 7, 2011 11:56:53 PM(UTC)
Groups: Registered
Posts: 101
Hi,
I followed your suggestion.
When you invert the image and apply WL (with proper flag based on GrayScaleType) it still reverts back to positive in some conditions.
My updated test project is available on following download link.
<Moderator: please send link to
support@leadtools.com>
PLEASE DELETE THE LINK AFTER YOU DOWNLOAD THE FILE.
Steps to reproduce the issue :-
1) Run the project
2) Click the "Invert" button
3) Reduce the "Center"
Image will revert back to positive. How should I avoid this ?
My observation is, if you increase the "Center" in step 3 above, image does not revert back to positive.
#6
Posted
:
Wednesday, June 8, 2011 5:31:31 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
I want to test this issue on my side. Please send your test project with the sample image to
support@leadtools.com and mention this forum post in your email.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#7
Posted
:
Thursday, June 9, 2011 12:26:54 AM(UTC)
Groups: Registered
Posts: 101
Hi,
I have sent a mail to support.
Ticket# 2011060910000077
Waiting for your reply here.
#8
Posted
:
Thursday, June 9, 2011 4:56:32 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
I sent you a reply regarding this issue in ticket# 2011060910000077 that you sent to support. Please check it and if you need to follow up, reply there.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#9
Posted
:
Thursday, June 9, 2011 5:03:30 AM(UTC)
Groups: Registered
Posts: 101
Hi,
I received your reply. I am copying it here. It may be helpful for others.
==========================
Hello Amit,
The reason image is going back to positive is that both the Invert and Window
Level process are working on the same LUT. Invert method with invert the
colors in the LUT and Applying Window Level will also fill the same LUT. You
can invert the image by window leveling it with start color of white and end
color of black.
If you are using COM for this, you can use ApplyLinearVOILUT with
VOI_LUT_REVERSE_ORDER flag for invert effect.
If for some reason you need to invert the actual image data, you need to set
the UseLUT Property to FALSE before calling the invert method.
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.