Mercurial > hg > orthanc
comparison OrthancServer/FromDcmtkBridge.cpp @ 1765:57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Oct 2015 16:49:25 +0100 |
parents | df331354cea2 |
children | b769623c806c |
comparison
equal
deleted
inserted
replaced
1764:9ead18ef460a | 1765:57b9e6890482 |
---|---|
253 if (minMultiplicity < 1) | 253 if (minMultiplicity < 1) |
254 { | 254 { |
255 throw OrthancException(ErrorCode_ParameterOutOfRange); | 255 throw OrthancException(ErrorCode_ParameterOutOfRange); |
256 } | 256 } |
257 | 257 |
258 bool arbitrary = false; | |
258 if (maxMultiplicity == 0) | 259 if (maxMultiplicity == 0) |
259 { | 260 { |
260 maxMultiplicity = DcmVariableVM; | 261 maxMultiplicity = DcmVariableVM; |
262 arbitrary = true; | |
261 } | 263 } |
262 else if (maxMultiplicity < minMultiplicity) | 264 else if (maxMultiplicity < minMultiplicity) |
263 { | 265 { |
264 throw OrthancException(ErrorCode_ParameterOutOfRange); | 266 throw OrthancException(ErrorCode_ParameterOutOfRange); |
265 } | 267 } |
266 | 268 |
269 LOG(INFO) << "Registering tag in dictionary: " << tag << " " << (DcmVR(vr).getValidVRName()) << " " | |
270 << name << " (multiplicity: " << minMultiplicity << "-" | |
271 << (arbitrary ? "n" : boost::lexical_cast<std::string>(maxMultiplicity)) << ")"; | |
272 | |
267 std::auto_ptr<DcmDictEntry> entry(new DcmDictEntry(tag.GetGroup(), | 273 std::auto_ptr<DcmDictEntry> entry(new DcmDictEntry(tag.GetGroup(), |
268 tag.GetElement(), | 274 tag.GetElement(), |
269 vr, name.c_str(), | 275 vr, name.c_str(), |
270 static_cast<int>(minMultiplicity), | 276 static_cast<int>(minMultiplicity), |
271 static_cast<int>(maxMultiplicity), | 277 static_cast<int>(maxMultiplicity), |
1446 throw OrthancException(ErrorCode_BadParameterType); | 1452 throw OrthancException(ErrorCode_BadParameterType); |
1447 } | 1453 } |
1448 | 1454 |
1449 return element.release(); | 1455 return element.release(); |
1450 } | 1456 } |
1457 | |
1458 | |
1459 DcmEVR FromDcmtkBridge::ParseValueRepresentation(const std::string& s) | |
1460 { | |
1461 if (s == "AE") | |
1462 return EVR_AE; | |
1463 | |
1464 if (s == "AS") | |
1465 return EVR_AS; | |
1466 | |
1467 if (s == "AT") | |
1468 return EVR_AT; | |
1469 | |
1470 if (s == "CS") | |
1471 return EVR_CS; | |
1472 | |
1473 if (s == "DA") | |
1474 return EVR_DA; | |
1475 | |
1476 if (s == "DS") | |
1477 return EVR_DS; | |
1478 | |
1479 if (s == "DT") | |
1480 return EVR_DT; | |
1481 | |
1482 if (s == "FD") | |
1483 return EVR_FD; | |
1484 | |
1485 if (s == "FL") | |
1486 return EVR_FL; | |
1487 | |
1488 if (s == "IS") | |
1489 return EVR_IS; | |
1490 | |
1491 if (s == "LO") | |
1492 return EVR_LO; | |
1493 | |
1494 if (s == "LT") | |
1495 return EVR_LT; | |
1496 | |
1497 if (s == "OB") | |
1498 return EVR_OB; | |
1499 | |
1500 if (s == "OF") | |
1501 return EVR_OF; | |
1502 | |
1503 if (s == "OW") | |
1504 return EVR_OW; | |
1505 | |
1506 if (s == "PN") | |
1507 return EVR_PN; | |
1508 | |
1509 if (s == "SH") | |
1510 return EVR_SH; | |
1511 | |
1512 if (s == "SL") | |
1513 return EVR_SL; | |
1514 | |
1515 if (s == "SQ") | |
1516 return EVR_SQ; | |
1517 | |
1518 if (s == "SS") | |
1519 return EVR_SS; | |
1520 | |
1521 if (s == "ST") | |
1522 return EVR_ST; | |
1523 | |
1524 if (s == "TM") | |
1525 return EVR_TM; | |
1526 | |
1527 if (s == "UI") | |
1528 return EVR_UI; | |
1529 | |
1530 if (s == "UL") | |
1531 return EVR_UL; | |
1532 | |
1533 if (s == "UN") | |
1534 return EVR_UN; | |
1535 | |
1536 if (s == "US") | |
1537 return EVR_US; | |
1538 | |
1539 if (s == "UT") | |
1540 return EVR_UT; | |
1541 | |
1542 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1543 } | |
1451 } | 1544 } |