comparison OrthancServer/FromDcmtkBridge.cpp @ 311:26efccdff583

anonymisation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2012 12:44:32 +0100
parents fbf2b2282086
children fc856d175d18
comparison
equal deleted inserted replaced
310:6ab6cdeedf4e 311:26efccdff583
570 DcmDataset& dataset = *file_->getDataset(); 570 DcmDataset& dataset = *file_->getDataset();
571 for (unsigned long i = 0; i < dataset.card(); i++) 571 for (unsigned long i = 0; i < dataset.card(); i++)
572 { 572 {
573 DcmElement* element = dataset.getElement(i); 573 DcmElement* element = dataset.getElement(i);
574 DcmTag tag(element->getTag()); 574 DcmTag tag(element->getTag());
575 if (tag.getPrivateCreator() != NULL) 575 if (!strcmp("PrivateCreator", tag.getTagName()) || // TODO - This may change with future versions of DCMTK
576 tag.getPrivateCreator() != NULL)
576 { 577 {
577 privateTags.push_back(element); 578 privateTags.push_back(element);
578 } 579 }
579 } 580 }
580 581
1276 char uid[100]; 1277 char uid[100];
1277 1278
1278 switch (level) 1279 switch (level)
1279 { 1280 {
1280 case DicomRootLevel_Patient: 1281 case DicomRootLevel_Patient:
1281 { 1282 // The "PatientID" field is of type LO (Long String), 64
1282 std::string uuid = Toolbox::GenerateUuid(); 1283 // Bytes Maximum. An UUID is of length 36, thus it can be used
1283 std::string id; 1284 // as a random PatientID.
1284 id.reserve(uuid.size()); 1285 return Toolbox::GenerateUuid();
1285 for (size_t i = 0; i < uuid.size() && i < 8; i++)
1286 {
1287 id.push_back(toupper(uuid[i]));
1288 }
1289
1290 return id;
1291 }
1292 1286
1293 case DicomRootLevel_Instance: 1287 case DicomRootLevel_Instance:
1294 return dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT); 1288 return dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT);
1295 1289
1296 case DicomRootLevel_Series: 1290 case DicomRootLevel_Series: