about windows center and windows width

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

about windows center and windows width

#1 Post by winstondcm »

hi, there,

i am wondering if the attribute has to be exist inside dicom file, so one can display it with center and width changeable.. i mean, if i didn't write any information when creating such dicom file, no dicom viewer can display it with center and width changed. right?

please help me clarify this confusion.. thank you very much.

winston.

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

also

#2 Post by winstondcm »

also, where to change the center and width in the code, right before createWindowsDIB()?

i did that, but no any effect for the result dib image displaying.

Code: Select all

di->SetWindow(c,w);
di->createWindowsDIB(data,0,24,1);
//.....display data.
it is put in the right place?

thank you.

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

yes

#3 Post by winstondcm »

throught experienment, i found there is no center/width changeable in RGB dicom file.. it only works in 8 bits graylevel dicom image.. even i created than the same way

it's that so? SetWindow(center, width) doesn't work for 24bit dicom image?


thank you very much.

winston

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Of course, VOI settings like window center/width only work for monochrome images. See DCMTK documentation and DICOM standard for details.

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

#5 Post by winstondcm »

yes, sir.

now i understand, and can set it so the outcome image has different display effect.

i have another post, could you look it for me. that is, i have this GE ultrasound dicom file, i can measure distance in millimeter, but don't have pixelspacing tag.. how that can be?


the thing is, i set this pixelspacing value in my created dicom, but the measuring distance is not it should be (pixelspacing x pixel number).

so i want to know how the file i mentioned store such information.

the dump file in another post:

thank you very much.

winston
viewtopic.php?t=2459

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

hi

#6 Post by winstondcm »

hi, Jorg

thank you for answering my question.

but, today, i found using Sante DICOM Viewer, it can adjust window center/width even to RGB color dicom file.. why is it so?

really.. i read several post here, and also you said. window leveling only works for monochrom dicom.. but i save a 24 bit RGB color dicom file, the Sante DICOM viewer also can adjust center/width... why? also, i simply convert a jpg file to dicom file (with img2dcm.exe), the resulting dicom file also can be adjusted center/width in Sante DICOM viewer.

please tell me how to do it..

thank you very much.

winston

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

confusing

#7 Post by winstondcm »

even if i convert the DicomImage to monochrome one, i still can not use window leveling, if the original dicom file is 24 bit RGB dicom.

Code: Select all

DicomImage *di = new DicomImage(...)
DicomImage *image = di->CreateMonochromeImage(...)
delete di;
di = image;

di->setWindow(wCenter,wWidth);
di->createWindowsDIB(data, 0, frame)
not working..

how can i do window leveling for 24 bit RGB dicom?

thanks a lot.

winston

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

If the image is monochrome (or converted to monochrome), you can use VOI transformation with DCMTK as dcm2pnm with option --grayscale (+G) shows. E.g.

Code: Select all

dcm2pnm +G +Ww 100 100 image.dcm image.pgm
Btw, a 24-bit RGB image converted to grayscale results in 8 bits per pixel (max. 256 shades of gray). Why do you want to apply windowing to such an image?

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

#9 Post by winstondcm »

thank you, jorg..

Code: Select all

Btw, a 24-bit RGB image converted to grayscale results in 8 bits per pixel (max. 256 shades of gray). Why do you want to apply windowing to such an image?
you meant: when i use di->CreateMonochromeImage() it's actually became a 8 bit gray image? oh.. then, that's not what i want.

what i want is that the effect the Sante DICOM viewer shows me. when it display a 24 bit RGB dicom, simply adjust the center/width bar, the displaying effect changs along, i.e. the contrast/brightness changes,(all color,R,G,B simultaneously). just like in grayscale dicom i did for window center/width.. i would achieve such effect..

but , with di->setWindow(c,w); di->CreateWindowsDIB(data,0,1,24) i cann't get it. (i found in the source code of setWindow(), it indeed requires monochrome..

what i really want is to window leveling the 24 bit RGB dicom file.. obviously setWindow() stops there since it judged di->isMonochromePtr() first..

so, what can i do?

thank you very much!.

winston.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#10 Post by Jörg Riesmeier »

You are mixing things up here: window/level is not brightness/contrast. I don't know what Sante viewer does but window levelling according to DICOM is only defined for grayscale images (see other postings).

DCMTK does not support brightness/contrast settings because it's not really useful for medical images. Of course, you can implement this function for monochrome and color images if you like.

winstondcm
Posts: 31
Joined: Wed, 2010-03-24, 17:14

#11 Post by winstondcm »

yes, jorg.

i understand now, what Sante Viewer did is just a kind of post-converting displaying effect. not really important and not a DICOM implement.

thank you for clarifying for me.

winston.

canarymu
Posts: 1
Joined: Mon, 2010-04-19, 02:56

#12 Post by canarymu »

thank for sharing! the instruction 's very good!

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#13 Post by Per »

Although DICOM does not define window levelling for RGB images, it is logically just the same as levelling for monochrome images, you just treat each colour layer as a separate monochrome image that are all adjusted by a single control. Although the precision is a mere 8 bits, being able to modify it is in my experience quite useful, and the lack of support for in DCMTK for this was somewhat disappointing.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Google [Bot] and 1 guest