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 Set Window Level and Window Width
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

PatrickH

4 Posts

Posted - Jan 30 2019 :  02:34:21  Show Profile  Reply
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

xequte

4399 Posts

Posted - Jan 30 2019 :  19:17:23  Show Profile  Reply
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/ImageEn/TIOParams.DICOM_WindowCenterOffset.html
https://www.imageen.com/help/ImageEn/TIOParams.DICOM_Range.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PatrickH

4 Posts

Posted - Jan 31 2019 :  05:38:50  Show Profile  Reply
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
Go to Top of Page

xequte

4399 Posts

Posted - Jan 31 2019 :  14:56:52  Show Profile  Reply
Hi Patrick

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

https://www.imageen.com/help/ImageEn/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
Go to Top of Page

PatrickH

4 Posts

Posted - Feb 01 2019 :  05:53:00  Show Profile  Reply
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
Go to Top of Page

xequte

4399 Posts

Posted - Feb 03 2019 :  17:46:44  Show Profile  Reply
Hi

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

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


You can email me for a pre-release.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: