Howto: Generate Unique Identifier (UID)

Here's an example that shows how the generation of three new UIDs works (e.g. to be used for a new SOP Instance created by dump2dcm) :

Source Code

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dcuid.h"
#include "dcmtk/ofstd/ofstream.h"
 
int main(int /*argc*/, char * /*argv*/ [])
{
    char uid[100];
    STD_NAMESPACE cout << "Study Instance UID  : " << dcmGenerateUniqueIdentifier(uid, SITE_STUDY_UID_ROOT) << OFendl;
    STD_NAMESPACE cout << "Series Instance UID : " << dcmGenerateUniqueIdentifier(uid, SITE_SERIES_UID_ROOT) << OFendl;
    STD_NAMESPACE cout << "SOP Instance UID    : " << dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT) << OFendl;
 
    return 0;
}
 
dcmtk/howto/generateuids.txt · Last modified: 2009/10/28 09:46 by riesmeier
 
Except where otherwise noted, content on this wiki is licensed under the following license:Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki