generate new UID
Moderator: Moderator Team
generate new UID
Hi!
I need to create a new series from a study. So, I need to generate new UID for that series. Is there any binary in the current release which can be used for this??
Gen
I need to create a new series from a study. So, I need to generate new UID for that series. Is there any binary in the current release which can be used for this??
Gen
-
- DCMTK Developer
- Posts: 2073
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi Gen,
there is no ready-to-use binary in DCMTK, that allows generation of a UID. You can write your own like this:
Then you are using the OFFIS UID root to generate a new series UID. If you don't like this, you've got to change the UID root constant in DCMTK.
Regards,
Michael
there is no ready-to-use binary in DCMTK, that allows generation of a UID. You can write your own like this:
Code: Select all
#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
#include "dcmtk/dcmdata/dcuid.h"
#include "dcmtk/ofstd/ofstream.h"
int main(int /*argc*/, char * /*argv*/ [])
{
char uid[100];
cout << "Series Instance UID : " << dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT) << endl;
return( 0 );
}
Regards,
Michael
-
- DCMTK Developer
- Posts: 2073
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
You could get your own UID root from a national institution in your country, in Germany it's the "DIN". But you have to pay for this some money per year. You can use the OFFIS UID root, it's very improbable, that somebody generates the same UID then. The DCMTK appends to this UID root different system and time specific numbers. Best is, if you leave it as it is.
Regards,
Michael
Regards,
Michael
-
- Posts: 53
- Joined: Thu, 2005-04-14, 15:07
- Location: St. Petersburg, Russia
[quote]
You could get your own UID root from a national institution in your country, in Germany it's the "DIN". But you have to pay for this some money per year.
[/quote]
I got UID root gratis from
Dave Harvey [dave@medicalconnections.co.uk]
Alexander.
You could get your own UID root from a national institution in your country, in Germany it's the "DIN". But you have to pay for this some money per year.
[/quote]
I got UID root gratis from
Dave Harvey [dave@medicalconnections.co.uk]
Alexander.
Last edited by Alexander Fedotov on Mon, 2006-04-24, 15:38, edited 1 time in total.
-
- OFFIS DICOM Team
- Posts: 1513
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Even if you continue to use the OFFIS UID root, while there is no guarantee that nobody else in the world will ever generate the same UID as your tool does, the probability is VERY low. We have put much effort in making the UID generation algorithm as good as possible. The UIDs contain a timestamp and a 32-bit "hostid" which on Windows systems is constructed as a checksum over various system features such as the MAC address of the first ethernet adapter. Only if the hostid happens to collide on two systems (probability 2^-32) and these systems happen to generate UIDs in the same second within processes using the same process ID, a collision is possible. The other thing to note is, if you use a UID root different from the OFFIS UID root, make sure that it is not longer than the OFFIS UID root because otherwise the generation algorithm could create UIDs longer than 64 characters, which is illegal. If I remember correctly, the dcmGenerateUniqueIdentifier() would in this case simply "cut" the UID to 64 chars, but then you might end up with real collisions.
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 1 guest