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!
Decompression codecs
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Decompression codecs
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
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
Re: Decompression codecs
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!
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!
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Decompression codecs
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
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
Re: Decompression codecs
Now it works!
thank you Michael
thank you Michael
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 1 guest