How to query DCMTK version

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kingcrimson-biubiu
Posts: 3
Joined: Thu, 2018-01-25, 13:46

How to query DCMTK version

#1 Post by kingcrimson-biubiu »

Dear forum,
May I know if there's a function in DCMTK that can return the API version (such as "3.6.3")? I searched the source repository in the 3.6.3 branch but didn't manage to find one. Thank you! 8)

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: How to query DCMTK version

#2 Post by J. Riesmeier »

There is a macro OFFIS_DCMTK_VERSION in "dcmtk/dcmdata/dcuid.h".

kingcrimson-biubiu
Posts: 3
Joined: Thu, 2018-01-25, 13:46

Re: How to query DCMTK version

#3 Post by kingcrimson-biubiu »

J. Riesmeier wrote:There is a macro OFFIS_DCMTK_VERSION in "dcmtk/dcmdata/dcuid.h".
Thanks for your reply, J. Riesmeier.

It appears that OFFIS_DCMTK_VERSION is an alias to PACKAGE_VERSION_SUFFIX, which is defined in dcmtk/config/osconfig.h

My 2 cents: It would be more convenient to users if, instead of being a preprocessor macro alone, the version number is made a return value of an API global function (say std::string GetVersionString()). It would also be helpful if it is accessible in CMake (say DCMTK_VERSION).

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: How to query DCMTK version

#4 Post by J. Riesmeier »

It appears that OFFIS_DCMTK_VERSION is an alias to PACKAGE_VERSION_SUFFIX, which is defined in dcmtk/config/osconfig.h
No, OFFIS_DCMTK_VERSION is defined as a concatenation of PACKAGE_VERSION and PACKAGE_VERSION_SUFFIX, e.g. "3.6.3+"
... the version number is made a return value of an API global function (say std::string GetVersionString()). It would also be helpful if it is accessible in CMake (say DCMTK_VERSION).
I am not a friend of global functions but what would be the advantage compared to a preprocessor macro; is it type safety?
What is wrong with the CMake variable DCMTK_PACKAGE_VERSION?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest