LEADTOOLS Support
General
General Questions
Re: Saving inverted raw image in dicom format using CSMainDemo_Original
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
Groups: Registered
Posts: 71
Hi,
Can you please help me to save the inverted raw image in DICOM format. I am trying it using CSMainDemo_Original but when i am applying window level and then invert operation on the image and then tried to save this inverted image, the result i am getting is the original image not the inverted one.
Please try this at your end and help me to save the inverted image after applying window level.
Thanks....
Groups: Registered, Tech Support
Posts: 179
I want to test this issue. Can you send me the source image in a ZIP or RAR file?
If the image is raw without header, what are the image properties (width, height, order, View Perspective, Fill Order, etc.)?
Also, what are the exact steps that show the problem using our demo?
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

Groups: Registered
Posts: 71
Hi,
As the size of the images is very large so i am unable to attach them here. If possible can you please download these images from the below link:
http://www.4shared.com/zip/Zp4eVxwM/RawImages.html
Below is the properties of image:
W = H = 3000
BPP = 16
Order = Grayscale
View Perspective = Top Left
Fill Order = MSB First
Steps:
1. Load the raw image with the above properties values.
2. Change the window center to 2048 and window width 4096.
3. Invert the image.
4 save the image.
the saved image will not show the invert results.
Groups: Registered, Tech Support
Posts: 179
I tested as follows:
1. I opened the RAW images you sent me using CSMainDemo_Original with the same properties you sent me.
2. I set the Window Center and Window width from Color -> Window Level to (2048,4096) and clicked OK in the dialog.
3. I used Invert from the Color menu.
4. From File -> Save menu item, I saved the image as Dicom Gray (*.dcm) with 16 BPP.
5. Re-open the saved DICOM image using the same demo.
The Window Level and the Invert changes were saved on the result (Dicom) images.
I'm attaching a screenshot that shows how the 2 images appear after loading them in step 5.
If the file version of your Leadtools.dll is earlier than 17.5.0.42, please download our latest build of LEADTOOLS v17.5 setup you can obtain from our site.
mohamed attached the following image(s):
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

Groups: Registered
Posts: 71
Hi,
Yes while opening the saved image in the same demo it is showing the inverted results. But when i am trying to open the saved dicom image in some other viewer such as MicroDicom it is not showing the inverted results. Can you please check this inverted image in Microdicom and then tell me why it is not showing inverted effect in saved image.
Thanks....
Groups: Registered, Tech Support
Posts: 179
The dataset that is saved using these steps is not really a completely valid data set. We only dumped the pixel data into a DICOM file without setting all proper tag values.
The resulting Dataset contains VOI LUT, so inverting only affects the LUT and not the image. You need to set UseLookuptable property to false that will change the pixeldata. Otherwise, our invert command will change the VOI LUT only, and if any
Non-lead viewer must check the VOI LUT to display the image inverted.
Without using the VOI LUT, any Non-lead viewer will show the image as the original image because the viewer ignored the VOI LUT.
You can instead set the Photometric Interpretation Tag (0028, 0004) to MONOCHROME1 and call DicomDataset.SetWindow to set the new Window Width (0028, 1051) and Window Center (0028,1050) values.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

LEADTOOLS Support
General
General Questions
Re: Saving inverted raw image in dicom format using CSMainDemo_Original
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.