how to get the current progress

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
YenShihHung
Posts: 8
Joined: Mon, 2011-08-08, 09:53

how to get the current progress

#1 Post by YenShihHung » Mon, 2011-08-08, 09:59

Hello ^ ^~

When performing a function of time, how to get the current progress

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

#2 Post by J. Riesmeier » Mon, 2011-08-08, 10:06

Could you please be a little more specific, e.g. what exactly is your use case and where comes DCMTK into play.

YenShihHung
Posts: 8
Joined: Mon, 2011-08-08, 09:53

#3 Post by YenShihHung » Mon, 2011-08-08, 10:21

J. Riesmeier wrote:Could you please be a little more specific, e.g. what exactly is your use case and where comes DCMTK into play.
Thank you for your reply ^ ^~.
This is the time when I perform some function,
For example, read from the CD a big JPEG-compressed DICOM image files may take 10 seconds,
But no way in the GUI system does not respond to endure 10 seconds, hoping to achieve progress in the implementation within the function.

YenShihHung
Posts: 8
Joined: Mon, 2011-08-08, 09:53

#4 Post by YenShihHung » Mon, 2011-08-08, 10:35

The same will be derived from another problem, when reading too much time, users want to interrupt the file to read, how safe because of the interruption.

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

#5 Post by J. Riesmeier » Wed, 2011-08-10, 14:03

So, you probably need to handle the time-consuming task in the background (different thread or process). A progress callback is only available for some of the network-related functions (see dcmnet module).

YenShihHung
Posts: 8
Joined: Mon, 2011-08-08, 09:53

#6 Post by YenShihHung » Thu, 2011-08-11, 02:39

Yes, except dcmnet outside in DcmData and DcmImage Some features require a longer running time.

For example, to open a thread more than 150MB of DICOM XA file and the jpeg decompression.
The progress of the program needs to be reflected to the user.
I want to know how to get this information?
Thank you

d2
Posts: 14
Joined: Wed, 2011-06-08, 14:39
Location: France

#7 Post by d2 » Thu, 2011-08-11, 15:09

I have the same wondering.
My software seems to be stuck during dicom reading. But I read a list of dicom files (about 512kB per file), so I can update a progress bar.

if there is no way to get the progression of dcmtk process, you can use some tricks:
1) Very ugly: make a logarithmic progress bar: fill your bar to half during 10 sec, then fill half remaining bar during 10 sec, and so on... :arrow:
2) Bad: provide in your software a little dicom file of few MB, and on startup, time the loading of this file. Log results in a file to avoid doing that at next startup. Then stat the file to be opened, and compute the estimated time to open it.
3) mix 1 and 2. First file opened: logarithmic progress bar and time the process. Next file opened, estimated time.
4) very clean: "Dear user, opening a dicom file can take a while. Please, do not shut down <name_of_your_software> during the process..." :)

good luck

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#8 Post by Uli Schlachter » Wed, 2011-08-17, 09:17

5) Use your own implementation of DcmFileProducer which additionally uses the current file offset to feed a progress bar.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest