ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 DICOM and window width/center again
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

FHarry

Germany
6 Posts

Posted - May 27 2015 :  07:16:42  Show Profile  Reply
Hi all,

yes, i have read one of the posts about how to do something like window-levelling for DICOM images. And that post does mainly just mention this code excerpt:
aImage.LegacyBitmap := false;
aImage.IO.NativePixelFormat := true;
aImage.IO.Params.DICOM_Range := iedrSetBlackWhite;
aImage.IO.LoadFromFileDicom(filename);

From this point on, it is told that i could do something like window-levelling by usage of the two properties:
aImage.IEBitmap.WhiteValue := someWidth;
aImage.IEBitmap.BlackValue := someCenter;

There is also a property mentioned "Dicom_WindowCenterOffset" which is described as "returns the calculated offset of the window center".
The Dicom_WindowCenterOffset value is the same as the value of the RescaleIntercept tag from the dicom file.

By activating this code excerpt
aImage.LegacyBitmap := false;
aImage.IO.NativePixelFormat := true;
aImage.IO.Params.DICOM_Range := iedrSetBlackWhite;
aImage.IO.LoadFromFileDicom(filename);
only images with NO modality LUT are displayed correctly. Other images having a modality LUT (Rescale slope is > 1 and Rescale Intercept is > 0) look strange. This sounds to me, as if i need to apply the so-called modality-LUT (the values from RescaleIntercept and RescaleSlope) on my own to the pixel data in order to get useful images. I think that this is exactly what a LoadFromFile() does if the NativePixelFormat is set to False.

For the images which have no modality LUT, and which are displayed fine, i however as well get strange whiteValue and BlackValues values.
I thought, they would somehow correspond to the WindowWidth and WindowCenter tags. But they are far off those values.

So this raises two questions:
1. If i have a modality LUT in my image (Rescale slope is > 1 and Rescale Intercept is > 0), how to process the image so that the image is displayed correctly. I need to have NativePixelFormat=false in order to allow window-levelling afterwards.

2. How do the properties BlackValue and WhiteValue correspond to Width and Center from the DICOM world?

Thanks to all of you,

Harry

xequte

38514 Posts

Posted - May 31 2015 :  19:38:48  Show Profile  Reply
Hi Harry

It is best that you review the source for iedicom.pas which will reveal the relationship between BlackValue/WhiteValue and WindowCenter+WindowWidth

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: