Faster way to get the pixel data

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
sharmila_s
Posts: 1
Joined: Fri, 2006-04-21, 02:43

Faster way to get the pixel data

#1 Post by sharmila_s »

Hi,

We are trying to build a 3D dataset from 2D slices. We are using dcmtk to read 2D DICOM slices. We are accessing the pixel data using getOutputData method of DicomImage.

void *pixelData = dicom_img.getOutputData(0,0,0);

When we used the profiler, we found out that getOutputData is taking lot of time compared to other parts of the code.

We are working on reducing the data loading time. Is there any other way to access the pixel data faster?

Thanks,
Sharmila

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

You can directly access the raw pixel data from the dataset by using findAndGetUint16Array(DCM_PixelData, ...). In that case, however, you have to do the pre-processing of the pixel data (such as applying rescale slope and intercept) by your own, and unless your code is very clever, I would predict that this will be slower than using the current method. The fact is simply that you have to apply certain preprocessing steps to each pixel of the DICOM image in order to convert them into something meaningful (such as Hounsfield units), and that takes CPU time. See also FAQ #24. There have been a number of discussion threads on the getInterData() method, which can be located by using the search option of the forum with getInterData as the search keyword.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest