Decompression codecs

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
gzhang
Posts: 50
Joined: Wed, 2015-09-02, 09:24

Decompression codecs

#1 Post by gzhang »

Hi,
I have been using dcmtk to decode compressed images. However, I wonder
1) is there a way to determine which codec exactly to use? DcmFileFormat::lookForXfer(DcmFileFormat->getmetaInfo()) and then compare to the E_TransferSyntax enum?
2) would it be reasonable to simply register DJLSDecoder, DJDecoder and RLEDecoder them all at the same time?
3) If I register a codec at the beginning of my main() and unregister at the end of main(), would it be possible to use the codes all across the application without a problem?
thanks!

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Decompression codecs

#2 Post by Michael Onken »

Hi,

regarding 2 and 3: Yes you can register and de-register your codecs in main() and use them throughout your application. This is the way we also do it in DCMTK (see for example code from dcmsend.cc).

regarding 1: Yes, you have to check get the transfer syntax from the meta header, and based on that decide which codec to use. However, if you register all codecs in main() you probably won't need that.

Best,
Michael

gzhang
Posts: 50
Joined: Wed, 2015-09-02, 09:24

Re: Decompression codecs

#3 Post by gzhang »

Hi Michael,
thanks for your reply :)
I take it that the codecs wouldn't conflict with each other if I register more than one, right?
BTW, for the 'DJLSDecoder', there's a always a linker error about unreferenced 'JpegLsReadHeader' and 'JpegLsDecode'. My linker is set with
-ldcmjpls -ldcm -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle -ldcmdata -loflog -lofstd
do you have any idea about this problem?
thank!

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Decompression codecs

#4 Post by Michael Onken »

Hi,

no, they do not conflict since every transfer syntax is handled by a single decoder.

Don't forget to link to libcharls if linking with dcmjpls module (similar as linking to libijg8/12/16 if using the dcmjpeg module). See for example the dependencies of dcmjpls/apps/dcml2pnm.cc.

Best,
Michael

gzhang
Posts: 50
Joined: Wed, 2015-09-02, 09:24

Re: Decompression codecs

#5 Post by gzhang »

Now it works!
thank you Michael :)

Post Reply

Who is online

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