Query rgarding Loading of DCM images

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Arunodaya S
Posts: 19
Joined: Mon, 2016-09-26, 14:08

Query rgarding Loading of DCM images

#1 Post by Arunodaya S »

Hi
Using the link : https://support.dcmtk.org/redmine/proje ... Multiframe we created a sample application to read Multiframe DCM images.

We are using DCMTK version 3.6.1 with MinGW.

Below is the code snippet to read the image.
{
//Starting timer before loading DCM image
Glib::Timer obimerDicomImage;
DicomImage *image = new DicomImage(sMaskImagePath.c_str(),
0,
0);

const DiPixel *obp = image->getInterData();
obp->getData();
double nTest = obimerDicomImage.elapsed();
std::cerr << "the time taken is.." << nTest << " seconds" << std::endl;

delete image;
}

If we try to load a DCM image of size 600MB, it takes approximately 4 seconds.
But if we close the application & start the application then load the same image it takes approximately 0.5 seconds.

1) Can someone please explain how after closing the application & starting it the time taken is reduced ?

However if we restart the system (Windows machine) & start the application & load the same image, then first time it takes approximately 4 seconds.

Also after loading a 600MB DCM file, if we load a different DCM file of lesser size (400MB) it takes approximately 3 seconds.
But if the same DCM file (400 MB) is loaded second time it takes approximately 0.5 seconds.

2) In case if we assume something to do with memory allocation, then why does a lower size image take such long time to load for the first time?

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Query rgarding Loading of DCM images

#2 Post by J. Riesmeier »

This has nothing to do with DCMTK but with your operating system and/or runtime environment. It seems that loading the DICOM file from the system's cache is much more efficient than loading it from harddisk (?), which is not really surprising.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest