dicom >> How to display dicom image by dcmtk?

by Lokicer » Tue, 13 Jul 2004 01:23:23 GMT

I am using dcmtk to deal with dicom image, I want to modify window center
and width and display it by dib, so firstly I set the current proper window
center and width by DicomImage::setWindow then create a DIB by
DicomImage::createWindowsDIB and show it, by now, it work corrently. When I
modified the window center and width at run-time, then create a new DIB by
DicomImage::createWindowsDIB and show it, but appearance of image is same.
Why? How should I do?

Thanks a lot and regards
Lokicer



dicom >> How to display dicom image by dcmtk?

by Joerg Riesmeier » Tue, 13 Jul 2004 03:56:36 GMT



A piece of sample code demonstrating this behaviour would be helpful.
Maybe, it's related to the wrong use of memory (internal vs. external).

Regards,
Joerg Riesmeier
OFFIS

dicom >> How to display dicom image by dcmtk?

by Lokicer » Tue, 13 Jul 2004 11:14:15 GMT

> A piece of sample code demonstrating this behaviour would be helpful.


First, Thanks for help.
The following is a piece of sample code
//m_pDibSection is a DIBSection object(8bpp grayscale bitmap), pDIBPixelData
point to pixel data in DIBSection
LPVOID pDIBPixelData = m_pDibSection->GetDIBits();
//nSizeDibData is the size of pixel data in byte
int nSizeDibData = m_pDibSection->GetPixelDataSize();
//pDcmImage is a DicomImage object, i want to initialize Dib pixel data with
dicom image.
UINT AllocBytes = pDcmImage->createWindowsDIB(pDIBPixelData, nSizeDibData,
0, 8, 1);
//These code can work correctly, i can see the dicom image
(wc=(min_value_dicom_pixel+max_value_dicom_pixel)/2, ww=max-min)

Then in other place, i modify the window center and width.
//Set center and width as i want
pDcmImage ->setWindow(Center, Width);
//Do the same code to update Dib pixel data , I don't kown if the window
center and width can change createWindowsDIB() behavior.
LPVOID pDIBPixelData = m_pDibSection->GetDIBits();
int nSizeDibData = pDibSection->GetPixelDataSize();
UINT AllocBytes = pDcmImage->createWindowsDIB(pDIBPixelData, nSizeDibData,
0, GRAYDEPTH, 1);
// But I see the image as same as above by DIBSection.

regards,
Lokicer

dicom >> How to display dicom image by dcmtk?

by Joerg Riesmeier » Tue, 13 Jul 2004 16:30:27 GMT


The use of createWindowsDIB() looks ok to me provided that
the pointer to the memory buffer (pDIBPixelData) and its size
(nSizeDibData) are correct. Have you already checked the
return value of createWindowsDIB() and setWindow()?

When I was creating a Windows DIB in the past I usually
created the pixel data with createWindowsDIB() first (and let
this function internally create the memory buffer, sometimes
I also re-used the buffer from last iteration in case of
multiple frames), set the required bitmap info header and
then finally used the Windows API function CreateDIBitmap()
to create the DIB.

Regards,
Joerg Riesmeier
OFFIS

PS: Realname would be nice.

dicom >> How to display dicom image by dcmtk?

by Colby Dillion » Wed, 14 Jul 2004 01:13:42 GMT

Just trying to rule things out, but are you invalidating your client area to
force a redraw after you update your levels? Or manually calling one of the
API's like SetDIBitsToDevice after your update?

Colby

dicom >> How to display dicom image by dcmtk?

by Lokicer » Wed, 14 Jul 2004 15:51:39 GMT

I have found the bug with your help, thanks a lot!

regards,
Lokicer

Similar Threads

1. what are display shutters and how do we use that while displaying a dicom image

2. what are display shutters and how do we use that while displaying a dicom image

I jsut now found out a group,elements  (0018,1600)-(0018-1624) which
tells everything about the display shutters can anybody explain the
use of Display shuuters.


Thanks and Regards
Amey.

3. what are display shutters and how do we use that while displaying a dicom image

4. dcmtk - using dcmconv to clean-up a DICOM image

Hi,

I am producing a DICOM image from a JPEG using gimp v2.0.5.  This
works pretty well, but the DICOM image so-produced needs some cleaning-
up.  At one time I got dcmconv to take care of most of the problems,
the most egregious of which was the absence of values for attributes
such as number of rows and columns, high bit, etc.  I'm embarrassed to
say that I can no longer produce this result; that is, I've forgotten
exactly which command line options I used.  Instead, I'm taking the
extra step of using dcmodify to set the correct values which is fine
but probably not the best way.  Can someone give me some guidance?
I'm using dcmtk v3.5.4.

On the other hand, it seems that I should be able to produce a valid
DICOM image from a JPEG in a more direct fashion using the dcmtk
utilities.  What am I missing?

Thanks,
Peyton Bland

5. Modify pixel data of Dicom image with Dcmtk

6. Display Dicom Image in Viewer

Hello , 
I need to add a ActiveX control ...the Dicomviewer in ASP>net .. 
I am able to do it fine in C# project but not in web application 
I add that Dicom dll (.ocx file) in my ASP.Net form 

I need to access this Viewer in my C# coding so that i can add image to 
that Dicom Viewer. 
please help me dude , 


thanks, 
Jayender 

7. How to display 16bit dicom image - CSharp/C#

8. Display of dicom medical images in a POVRAY plane

Hi,
I am looking for some help displaying dicom images in POVRAY.
The image can have an arbitray 3D rotation and translation.
The dicom image has information about the 3D rotation and translation
in the image header as:
 
"Image Orientation (Patient)" Tags (0020,0037)
"Image Position (Patient)",  Tag (0020,0032)

which contain two unit vectors for the row and column directions and
the spatial position of the first pixel of the image.


My best guess has been:

#declare rowvector=<-0.469,0.88294,0> ;    
#declare columnvector=<0.35207458,0.18720136,-0.91706005>; 
#declare firstpixelposition = <60.545587,-182.96286,184.31824>;  
plane {     
        <0,0,1>, 0  
        pigment { image_map {jpeg "file" once } }
        translate <0,-1,0>
        Reorient_Trans(<0,-1,0>,columnvector)
        Reorient_Trans(<1,0,0>,rowvector) 
        translate   firstpixelposition 
}   

This is close, but doesn't work for double oblique slice.

If anyone has done this or wants to help out, 
Your help would be greatly appreciated,

Lisa