Difficulties with DICOM example and DCMTK

I’m having the exact same trouble as posted in this old SLAC hypernews link but there was no publicly available resolution to the reported problem. https://hypernews.slac.stanford.edu/HyperNews/geant4/get/medical_app/412/1/1.html

It seems to me to be a problem with building DCMTK from source. If I obtain DCMTK from my package manager (apt-get install dcmtk on Ubuntu 16.04) and inspect ‘1.dcm’ in the DICOM example using the ‘dcmdump’ executable, it will spit out correctly that the modality of the ‘1.dcm’ file is [CT]; however, it is my understanding I also need the shared libraries such that the GEANT DICOM example can compile correctly; thus the executables from package manager aren’t enough (am I wrong here?)

I tried building DCMTK from source (and tried both versions 3.6.2 and 3.6.5), make sure to enable ‘BUILD_SHARED_LIBS’ in the cmake config but both the DICOM example and ‘dcmdump’ when built from source will incorrectly identify the modality of the example ‘1.dcm’ file as [43] (amongst many other incorrect tags).

Anyone have an idea of what I’m doing wrong?

Hi David. Have you solved that? I have the same issue.

Better late than never…

I solved this by setting the environment variable DCMDICTPATH to the full path of the dicom.dic file(not just the directory) as explained here: https://forum.dcmtk.org/viewtopic.php?t=13. Following the steps of that old SLAC hypernews thread that you posted, I used the dcmdump like you but got the error “no data dictionary loaded, check environment variable: DCMDICTPATH”. Setting that in my .bashrc file fixed the issue.

And of course dcmtk has to be built with shared libraries and not static.

1 Like

Thank you! After hitting a dead end I didn’t follow up on this.