dcmj2pnm.exe cant convert large multiframe US

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jberger
Posts: 30
Joined: Thu, 2015-09-03, 09:36

dcmj2pnm.exe cant convert large multiframe US

#1 Post by jberger »

Hello,

I found a problem with dcmj2pnm.exe (on Win 8.1). If processing a large multiframe US DICOM file (780 frames),

Code: Select all

./dcmj2pnm +Fa +op -O --log-level trace 1539350239 ../mf
I get the following error message:

Code: Select all

E: can't convert input pixel data, probably unsupported compression
If I limit the frame extraction to 393 frames:

Code: Select all

 ./dcmj2pnm +Fr 1 394 +op -O --log-level trace 1539350239 ../mf
it works well.
One frame more, and I get the error message again.

On Mac OS X 10.11.4, this problem does not exist.

Any ideas?

jberger

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

Re: dcmj2pnm.exe cant convert large multiframe US

#2 Post by J. Riesmeier »

By default, the underlying DicomImage class loads all pixel data into memory and, in case of compressed images, decompresses it completely. So I guess, your Windows system is out of memory or, to be more precise, the dcmj2pnm process allocates more than 2 GB of main memory (which is the maximum for 32-bit applications on Windows).

A solution would be to limit the number of frames kept in memory. For the dcmj2pnm command line tool, you've already found the corresponding option. For the DicomImage class, there is a HOWTO with sample code.

jberger
Posts: 30
Joined: Thu, 2015-09-03, 09:36

Re: dcmj2pnm.exe cant convert large multiframe US

#3 Post by jberger »

Many thanks for your reply. It would be a pain to rewrite my shell script to check for frame count first and extract in portions ... :-(

Is there a windows 64bit version of dcmj2pnm?

jberger

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

Re: dcmj2pnm.exe cant convert large multiframe US

#4 Post by J. Riesmeier »

I just compiled the current DCMTK snapshot with Visual Studio 2015 (64 bit). Here's the dcmjp2nm.exe tool.

jberger
Posts: 30
Joined: Thu, 2015-09-03, 09:36

Re: dcmj2pnm.exe cant convert large multiframe US

#5 Post by jberger »

Many many thanks for this, Jörg!

This solved the problem, as far as I can see after set up a 64bit VM to make the tests reliable.
May I ask if there are 64bit versions of dcmdump and storescp too?

Awesome support anyway!!!

Thanks again,

jberger

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

Re: dcmj2pnm.exe cant convert large multiframe US

#6 Post by J. Riesmeier »

Sure, here is a ZIP archive with both EXE files.

jberger
Posts: 30
Joined: Thu, 2015-09-03, 09:36

Re: dcmj2pnm.exe cant convert large multiframe US

#7 Post by jberger »

Thank you very much again!

jberger

Post Reply

Who is online

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