Questions on generatuing UID

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jmartens
Posts: 15
Joined: Wed, 2005-02-02, 10:36

Questions on generatuing UID

#1 Post by jmartens »

In FAQ 25 I read the following:
Marco Eichelberg wrote:The UID generation algorithm in DCMTK may add up to 48 characters to your UID root (38 characters plus the value of an unsigned int counter), make sure that you do not break the 64 character limit on a UID
So if I would like to generate unique study UID's for instance our site UID should have a maximum of 16 charachter. Is this including the dot (separator)?

How is this unique part f the UID generated? IP number, MAC address, date, time, counter?

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

#2 Post by Jörg Riesmeier »

The UID root usually does not include the trailing ".", but if it does the trailing "." is stripped automatically. Btw, the algorithm which is used by DCMTK makes sure that the UID does not exceed the 64 characters limit -- at least this is what the algorithm should do ;-)

To your second question: This partly depends on the platform. However, the basic structure is: "<root>.<hostid>.<pid>.<time>.<counter>". See implementation of dcmGenerateUniqueIdentifier() in dcmdata/libsrc/dcuid.cc for details.

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

#3 Post by Marco Eichelberg »

The operating system specific part is actually the <hostid> component which is based on the gethostid() system function on Posix platforms and uses some rather obscure (but necessary) code on Windows to determine the MAC address of the first ethernet adapter from which a hostid is derived.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest