DCMTK MacOS Installation Homebrew

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

DCMTK MacOS Installation Homebrew

#1 Post by jazibaskari »

Hi! I'm new to C++ and DCMTK and I think I've completed the steps to install Homebrew and the DCMTK toolkit onto my Mac. I've attempted to run commands like dcmdump to read the header of my DICOM files in the terminal and it seems to be working. When I try this using the CodeBlocks IDE however, the compiler doesn't recognise the toolkit. I can't seem to find further instructions on how to start using DCMTK with my IDE (CodeBlocks) but I'm assuming I need to tell the IDE where the header files are. I'm not sure how I would go about finding the location of the header files or how to link the toolkit to my IDE to ensure I can read the tags in my DICOM header. There's not much documentation on how to read the tags in DICOM file using C++ either so any help would be appreciated. Thank you.

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

Re: DCMTK MacOS Installation Homebrew

#2 Post by Michael Onken »

Hi,

I don't know CodeBLlocks so I cannot help with that.

Here is a hit how you can include DCMTK into your CMake-based project using CMake's find_package mechanism.

General examples how to read and write DICOM files and how to access DICOM tags can be found in the dcmdata documentation (scroll down to code example).

Best regards,
Michael

jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

Re: DCMTK MacOS Installation Homebrew

#3 Post by jazibaskari »

Thanks for your help but after reading the contents of the provided link I'm still not sure how to go about using the find_package mechanism to include DCMTK into my IDE. Could you perhaps explain the process? Thanks

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

Re: DCMTK MacOS Installation Homebrew

#4 Post by Michael Onken »

Hi,

Maybe your IDE can directly load a project by opening the main CMakeLists.txt file?

Best regards,
Michael

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

Re: DCMTK MacOS Installation Homebrew

#5 Post by Michael Onken »

PS or create a CodeBlocks project file, see here for example: https://stackoverflow.com/questions/376 ... cmake-file

Also, CodeBlocks should show up on the cmake GUI if you prefer the GUI.

jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

Re: DCMTK MacOS Installation Homebrew

#6 Post by jazibaskari »

Hi again. I'm really new to this so I'd appreciate it if you could explain everything in layman's terms. Why is the CMakeLists.txt file important? I need to link the header files to the compiler in my IDE, I don't see how that txt file is relevant?

jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

Re: DCMTK MacOS Installation Homebrew

#7 Post by jazibaskari »

I know I can manually add the header files into my CodeBlocks project but there should be an easier way to do this via command line? How do I get the path of all my header files? And am I correct in thinking that the .h files contain the libraries that I'd need to #include at the top of my code?

jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

Re: DCMTK MacOS Installation Homebrew

#8 Post by jazibaskari »

Update: I've found a way to link the libraries to my project in CodeBlocks: https://www.learncpp.com/cpp-tutorial/a ... odeblocks/
In the link its mentioned that you need to link both the header and library files. I know where the header files are stored in the installed dcmtk folder but where are the library files stored? Or are both the header and library files the same? I'd appreciate any clarification.
Last edited by jazibaskari on Sun, 2020-07-26, 19:17, edited 1 time in total.

jazibaskari
Posts: 9
Joined: Fri, 2020-07-10, 11:19

Re: DCMTK MacOS Installation Homebrew

#9 Post by jazibaskari »

I'd also appreciate it if you could tell me which header files the following interface classes are stored in so that I'm able to test some code after manually linking the header files to my IDE:
DcmFileFormat
DcmDataset
DcmItem
DcmElement
Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest