I am working on a project where I have to read a dicom image.
I am unable to install dcmtk. I am using win7 64-bit and vs2010.
Please explain the procedure to include dcmtk in my program.
I am working on a project where I have to read a dicom image.
I am unable to install dcmtk. I am using win7 64-bit and vs2010.
Please explain the procedure to include dcmtk in my program.
We have a project that is an implementation of DCMTk in Qt -- we call it QtDICOM, and it forms the foundation of many of our products (http://fluxinc.ca/medical)/. Worth a look (https://bitbucket.org/fluxinc/qt-dicom). We haven't documented the configuration particularly well, but you can probably figure it out if you have a look.
Note: It does depend on DCMTk being built and included in the various paths.
The Common Toolkit guys have addressed some of these issues. You could also use the Insight Toolkit
http://www.commontk.org/index.php/Main_Page
http://itk.org
In fact there is a bit of documentation on the ITK wiki, but ITK uses gdcm instead of dcmtk.
http://www.itk.org/Wiki/ITK_FAQ#How_to_read_a_volume_from_a_DICOM_series
To use the
Windows
+DCMTK
+QT
, you need to execute these follow steps:1) Compile the DCMTK
First of all, to use the DCMTK library in your application, you should compile the DCMTK source code to generate the libraries:
While I am writing this, the last available version is 3.6.0. So, we should download it:
ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/dcmtk360/dcmtk-3.6.0.zip
After the download is finished, you need to unzip the folder. The DCMTK source doesn't have a project file, but it is not a problem, there is a CMakelist file responsible for generating a project file in your desirable Operational System/Compiler. If you are not familiar with CMake tool, you can read more here (https://cmake.org/)
1.A) Compiling on Windows/Visual Studio 2012
1.A.1) You need to have an installed compiler, in my case, it was the Visual Studio 2012
1.A.2) Run the
CMake tool
to generate a project file to Visual Studio 2012. You need be able to fill thesource
DCMTK directory.1.A.3) Now, execute the VisualStudio 2012, open the file
sln
created in the previous step (2) and compile the targetALL_BUILD
1.A.4) Re-Execute VisualStudio in
Admin
mode (because of permissionC:\Program Files
) to compile the targetINSTALL
(it will copy and install the DCMTK to default path:C:/Program Files/DCMTK/
, we can reference it such PATH_WHERE_DCMTK_WAS_INSTALLED)(1.B) Compiling on GNU/Linux GCC
I have tested at Ubuntu/CentOS. The first, you should go to
DCMTK Source
and run these following three commands:example: path_to_dcmtk = /home/user/dcmtk
2) Creating your sample application
Create a file called
your_sample/testapp.cxx
with the following content. This a demonstration found in DCMTK Forum to open a DICOM file and print the patient's name.3) Creating the Application Project using the VisuaStudio as Compiler
The created file at the previous step needs to be placed in a project. You can choose between the option
Windows VisualStudio (3.1)
andWindows Qt (3.2)
. If you are using Linux, you can skip this step.3.A) Windows with Visual Studio 2012 IDE
To create a Visual Studio project, you can use the
Wizard
and set the necessary settings such:Linker
,Libraries
, etc. However, to make easier on this answer, I will use theCMakeList.txt
to create a Project for Visual Studio 2012. So, please, create a file calledyour_sample/CmakeList.txt
with the following content:3.B) Windows QtCreator IDE using the VisuaStudio as Compiler
To create a project file for QtCreator IDE. You need to create a file called
your_sample/my_project.pro
with the following content:4.A) Windows with Visual Studio 2012 IDE
Open the project file at
VisualStudio
and click onBuild
.4.B) Windows with QtCreator IDE using the VisuaStudio as Compiler
Open the project file at
QT
and click onBuild
.4.C) GNU/Linux - Command Line with GCC
References
How Install http://support.dcmtk.org/docs/file_install.html
DCMTK Docs http://support.dcmtk.org/docs/
FAQ #40: How do I use the DCMTK libraries in my own application? [MSVC] http://forum.dcmtk.org/viewtopic.php?f=4&t=652
CMake Configuration http://support.dcmtk.org/wiki/dcmtk/howto/cmakeconfiguration360
Try to follow the instructions for the Dcmtk installation. If you don't know how to include the library in your project, study the qmake manual.