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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 DICOM Set Window Level and Window Width

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PatrickH Posted - Jan 30 2019 : 02:34:21
Hi,

we have a DICOM-File with Preset-Values (Window Level 2047 and Window Width 4095).. a good view would be by Level=152, Width=1616.

Is it possible to change this values to customize the view? Like ImageEnView1->Proc->SetWWWL(x, y)

Best Regards,
Patrick
9   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 29 2019 : 16:21:43
Hi

Please email me for a fix for this.


Nigel
Xequte Software
www.imageen.com
rbeaulieu Posted - Oct 26 2019 : 12:52:56
Hi Nigel,

Sorry, I forgot to tell that I want open the image in a window width and level ajustement goal, so I load image with this code :

IEV1.IO.NativePixelFormat := true;
IEV1.IO.Params.DICOM_Range := iedrSetBlackWhite;
IEV1.IO.LoadFromFile(AFName);

The image at le left is WW and WC adjusted by setting black and white level. The function work well for DICOM image with rescale slope set to 1.0.

The same image at the right is correctly show in a popular DICOM viewer.



Regards.
xequte Posted - Oct 23 2019 : 15:34:07
Hi Regent

This image looks OK to me. Can you clarify your requirements:



Nigel
Xequte Software
www.imageen.com
rbeaulieu Posted - Oct 22 2019 : 18:08:36
Hi,

How can I correctly display the attached DICOM image using WWidth and WLevel (range iedrSetBlackWhite).

I think the issue has something to do with rescaleslope, wich is 2.81 and data type valid range exceed in code (word = trunc(double) causing word value restart from 0).

Someone can help ?
(sample dicom file attached)

Regent.

attach/rbeaulieu/2019102218416_Chest.zip
2322.62 KB

Regards.
xequte Posted - Feb 03 2019 : 17:46:44
Hi

In the next release you can control it using IEGlobalSettings().IOParamDefaults:

https://www.imageen.com/help/TIEImageEnGlobalSettings.IOParamDefaults.html


You can email me for a pre-release.

Nigel
Xequte Software
www.imageen.com
PatrickH Posted - Feb 01 2019 : 05:53:00
Hi Nigel,

if i load the file (multiple frames) like this:
ImageEnMView1->MIO->NativePixelFormat = true;
ImageEnMView1->MIO->LoadFromFile("D:\\ZZ_Temp\\Multi\\I24.dcm"); // multiframe file


the PixelValues are adjusted (maybe) in "iedicom.pas"
procedure TDicomReadContext.AdjustRange16g();
begin
  case IOParams.DICOM_Range of
    iedrAdjust:        AdjustRange16g_adjust();
    iedrSetBlackWhite: AdjustRange16g_set();
  end;
end;


The Usermanual says:

TIOParams.DICOM_Range
Declaration
property DICOM_Range: TIEDicomRange;
Description
Specifies how to handle the pixel visibility range.
Default: iedrAdjust

so if i load the File the Bitmaps are already modified.
Is there a way to set DICOM_Range to iedrSetBlackWhite before loading a file to ImageEnMView to get the unmodified Images?



Regards
Patrick
xequte Posted - Jan 31 2019 : 14:56:52
Hi Patrick

After loading you can iterate through the bitmaps using ImageEnMView1.GetTIEBitmap();

https://www.imageen.com/help/TImageEnMView.GetTIEBitmap.html

Wrap this and the loading code in LockUpdate/UnlockUpdate calls to prevent onscreen ugliness.


Alternatively, you can load your dicom image into a TIEBitmap, and then append that to the TImageEnMView (iterating if the image has multiple frames).



Nigel
Xequte Software
www.imageen.com
PatrickH Posted - Jan 31 2019 : 05:38:50
Hi,

ok, now it works great with TImageEnView

TIEBitmap *bmp = new TIEBitmap();
TImageEnIO *pIO = new TImageEnIO(bmp);
pIO->NativePixelFormat = true;
pIO->Params->DICOM_Range = iedrSetBlackWhite;
pIO->LoadFromFile("D:\\slice-205.dcm");
double dcenter = pIO->Params->DICOM_WindowCenterOffset + this->edLevel->Text.ToDouble();
double dMin =  dcenter - 0.5 - (this->edWidth->Text.ToDouble() -1) /2;
double dMax = dcenter - 0.5 + (this->edWidth->Text.ToDouble() -1) /2;
bmp->BlackValue = dMin;
bmp->WhiteValue = dMax;
this->img->IEBitmap->Assign(bmp);


The only thing left is the same with MultiSlice-Files. Here we use TImageEnMView to load the File.

ImageEnMView1->MIO->Params->DICOM_Range = iedrSetBlackWhite;
ImageEnMView1->MIO->LoadFromFile("D:\\Multi\\I24.dcm");


Params is here not possible because ImageEnMView1->MIO->Params = NULL
Is it possible to set the DICOM_Range before loading the File to TImageEnMView?

Patrick
xequte Posted - Jan 30 2019 : 19:17:23
Hi

You can apply custom Windows center and width values by setting ImageEnView1.BlackValue and WhiteValue:

ImageEnView1.IEBitmap.BlackValue := WindowCenter - Round(0.5 * WindowWidth);
ImageEnView1.IEBitmap.WhiteValue := WindowCenter + Trunc(0.5 * WindowWidth);
ImageEnView1.Update();


Also see:
https://www.imageen.com/help/TIOParams.DICOM_WindowCenterOffset.html
https://www.imageen.com/help/TIOParams.DICOM_Range.html

Nigel
Xequte Software
www.imageen.com