Setting the SITE_UID_ROOT with CMake

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ybu
Posts: 7
Joined: Tue, 2005-01-18, 20:19

Setting the SITE_UID_ROOT with CMake

#1 Post by ybu »

Hi,

Dcmtk version: 3.5.3
Environment: WinXP

I am using cmake to generate the VC projects. I would like to set the SITE_UID_ROOT. I checked the faq and found this. It explains how to proceed with a Makefile but as I am using cmake...

I also saw a reference in dcmtk-3.5.3/config/docs/macros.txt. I guessed that if I add

Code: Select all

ADD_DEFINITION(-D_REENTRANT)  # just to set where I add my line ;)
ADD_DEFINITION(-DSITE_UID_ROOT="my.own.root.uid")
in the dcmtk-3.5.3/cmakelist.txt file it should work, shouldn't it?

If not, where can I set the SITE_UID_ROOT while using cmake?

Thanks,
Yannick.

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#2 Post by Thomas Wilkens »

Your suggestion is almost right. The following should work:

Code: Select all

ADD_DEFINITIONS(-DSITE_UID_ROOT=\\\"1.2.3.4.5\\\")
Insert this code in file dcmtk-3.5.3\CMakeLists.txt at the line you indicated.

jmartens
Posts: 15
Joined: Wed, 2005-02-02, 10:36

#3 Post by jmartens »

Thomas Wilkens wrote:Your suggestion is almost right. The following should work:

Code: Select all

ADD_DEFINITIONS(-DSITE_UID_ROOT=\\"1.2.3.4.5\\")
Insert this code in file dcmtk-3.5.3\CMakeLists.txt at the line you indicated.

I have done so, but everytime when I run the wlmscpfs and send a C-ECHO from one of our modalities I read the following:

Code: Select all

Our Implementation Class UID:    1.2.276.0.7230010.3.0.3.5.3
Our Implementation Version Name: OFFIS_DCMTK_353
Their Implementation Class UID:    1.2.826.0.1.3680043.2.737
It looks to me that the implementation class UID is still the OFFIS UID instead of my own site UID. Am I correct? Can someone help me out?

I have the lastest version of CMAKE (2.0 - patch 6) and am trying to make dsp/dsw files for Microsoft Visual Studio 6 SP6 and am building on Win XP SP 2.

Thanks in advance!

Jonathan

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

The SITE_UID_ROOT is only used for generating new UIDs. The network module always uses OFFIS_IMPLEMENTATION_CLASS_UID (which is also defined in "dcuid.h") to identify itself.

jmartens
Posts: 15
Joined: Wed, 2005-02-02, 10:36

#5 Post by jmartens »

Thomas Wilkens wrote:Your suggestion is almost right. The following should work:

Code: Select all

ADD_DEFINITIONS(-DSITE_UID_ROOT=\\"1.2.3.4.5\\")
Insert this code in file dcmtk-3.5.3\CMakeLists.txt at the line you indicated.
I added the above line to my cmakelist.txt with my Site UID and like to build some tools with our own site uid.

Environment:
- Windows XP SP2
- DCMTK 3.5.3
- MS VC++ 6 SP 6
- CMAKE 2.0 patch 6

I ran CMAKE and now I try to compile the toolkit in MS VC++, especially dump2dcm. However when I set this project as my active project and try to execute the 'Rebuild all' option the compiler says the following:

Code: Select all

Deleting intermediate files and output files for project 'ofstd - Win32 Debug'.
Deleting intermediate files and output files for project 'dcmdata - Win32 Debug'.
Deleting intermediate files and output files for project 'dump2dcm - Win32 Debug'.
--------------------Configuration: ofstd - Win32 Debug--------------------
Building Custom Rule "D:\My Projects\dcmtk\ofstd\libsrc\CMakeLists.txt"
-- Check for working C compiler: cl -- works
-- Check for working CXX compiler: cl -- works
-- Configuring done
-- Generating done
-- Build files have been written to: D:/My Projects/dcmtk
--------------------Configuration: dcmdata - Win32 Debug--------------------
Building Custom Rule "D:\My Projects\dcmtk\dcmdata\libsrc\CMakeLists.txt"
-- Check for working C compiler: cl -- works
-- Check for working CXX compiler: cl -- works
-- Configuring done
-- Generating done
-- Build files have been written to: D:/My Projects/dcmtk
--------------------Configuration: dump2dcm - Win32 Debug--------------------
Building Custom Rule "D:\My Projects\dcmtk\dcmdata\apps\CMakeLists.txt"
-- Check for working C compiler: cl -- works
-- Check for working CXX compiler: cl -- works
-- Configuring done
-- Generating done
-- Build files have been written to: D:/My Projects/dcmtk

dump2dcm.exe - 0 error(s), 0 warning(s)
So I think erveything should be OK, however no executable is created no where in the directory tree, does anyone know what could be the problem?

I also tried to build the whole project but then the process breaks and I get the following error while the compiler is building the dcmjpeg library:

Code: Select all

--------------------Configuration: dcmcjpeg - Win32 Debug--------------------
Building Custom Rule "D:\My Projects\dcmtk\dcmjpeg\apps\CMakeLists.txt"
-- Check for working C compiler: cl -- works
-- Check for working CXX compiler: cl -- works
-- Configuring done
-- Generating done
-- Build files have been written to: D:/My Projects/dcmtk
Linking...
LINK : fatal error LNK1181: cannot open input file "dcmimgle.lib"
Error executing link.exe.

ALL_BUILD - 1 error(s), 0 warning(s)
This dcmimgle.lib file is also not created anywhere on my system.

It seems to be that only the following three lib files are generated as I can find them with the modified timestamp at the time I started compiling on my system:
- ij8.lib
- ijg12.lib
- ijg16.lib



Hopefully someone can help me out or give me a hint where to look at/start looking.

Horst Balthasar
Posts: 32
Joined: Mon, 2021-02-01, 11:32

Re: Setting the SITE_UID_ROOT with CMake

#6 Post by Horst Balthasar »

We have received our UID and I wanted to use it in our application.
I have recompiled the DCMTK with:

cmake -DSITE_UID_ROOT=“1.2.826.0.1.3680043.10.1395” -DDCMTK_ENABLE_CXXX11:BOOL=ON -DDCMTK_CXX11_FLAGS=-std=c++14 -DBUILD_SHARED_LIBS=ON -DDCMTK_ENABLE_STL:BOOL=ON -DCMAKE_BUILD_TYPE=“Release” ..

Unfortunately, your UID (for the Study and Series UID) is still present in the dcm file.

Did I do something wrong during the recompilation?

We are using dcmtk version 3.6.5 on Debian 10.

Best regards
Horst

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Setting the SITE_UID_ROOT with CMake

#7 Post by Marco Eichelberg »

  • SITE_UID_ROOT needs to be passed to the C++ compiler. You are just defining a CMake variable that never gets used. Try CXXFLAGS=-DSITE_UID_ROOT=\"1.2.826.0.1.3680043.10.1395\" cmake -DDCMTK_ENABLE_CXXX11:BOOL=ON ...
  • I suspect that your UID root is too long for the UID generation algorithm in DCMTK. DCMTK may add up to 44 characters to the UID root, and your UID root is 28 characters. That is too long for the maximum of 64 characters permitted for a UID. You will either have to get a shorter UID root or revise the algorithm in dcmGenerateUniqueIdentifier().

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest