comparison Core/Enumerations.cpp @ 2007:655489d9165d

DicomMap::ParseDicomMetaInformation()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 Jun 2016 15:46:33 +0200
parents 6301bbcbcaed
children 7a969f235adf
comparison
equal deleted inserted replaced
2006:6301bbcbcaed 2007:655489d9165d
972 { 972 {
973 return ValueRepresentation_OtherWord; 973 return ValueRepresentation_OtherWord;
974 } 974 }
975 else if (vr == "PN") 975 else if (vr == "PN")
976 { 976 {
977 return ValueRepresentation_PatientName; 977 return ValueRepresentation_PersonName;
978 } 978 }
979 else if (vr == "SH") 979 else if (vr == "SH")
980 { 980 {
981 return ValueRepresentation_ShortString; 981 return ValueRepresentation_ShortString;
982 } 982 }
1331 bool IsUserContentType(FileContentType type) 1331 bool IsUserContentType(FileContentType type)
1332 { 1332 {
1333 return (type >= FileContentType_StartUser && 1333 return (type >= FileContentType_StartUser &&
1334 type <= FileContentType_EndUser); 1334 type <= FileContentType_EndUser);
1335 } 1335 }
1336
1337
1338 bool IsBinaryValueRepresentation(ValueRepresentation vr)
1339 {
1340 // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
1341
1342 switch (vr)
1343 {
1344 case ValueRepresentation_ApplicationEntity: // AE
1345 case ValueRepresentation_AgeString: // AS
1346 case ValueRepresentation_CodeString: // CS
1347 case ValueRepresentation_Date: // DA
1348 case ValueRepresentation_DecimalString: // DS
1349 case ValueRepresentation_DateTime: // DT
1350 case ValueRepresentation_IntegerString: // IS
1351 case ValueRepresentation_LongString: // LO
1352 case ValueRepresentation_LongText: // LT
1353 case ValueRepresentation_PersonName: // PN
1354 case ValueRepresentation_ShortString: // SH
1355 case ValueRepresentation_ShortText: // ST
1356 case ValueRepresentation_Time: // TM
1357 case ValueRepresentation_UnlimitedCharacters: // UC
1358 case ValueRepresentation_UniqueIdentifier: // UI (UID)
1359 case ValueRepresentation_UniversalResource: // UR (URI or URL)
1360 case ValueRepresentation_UnlimitedText: // UT
1361 {
1362 return false;
1363 }
1364
1365 /**
1366 * Below are all the VR whose character repertoire is tagged as
1367 * "not applicable"
1368 **/
1369 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
1370 case ValueRepresentation_FloatingPointSingle: // FL (float)
1371 case ValueRepresentation_FloatingPointDouble: // FD (double)
1372 case ValueRepresentation_OtherByte: // OB
1373 case ValueRepresentation_OtherDouble: // OD
1374 case ValueRepresentation_OtherFloat: // OF
1375 case ValueRepresentation_OtherLong: // OL
1376 case ValueRepresentation_OtherWord: // OW
1377 case ValueRepresentation_SignedLong: // SL (int32_t)
1378 case ValueRepresentation_Sequence: // SQ
1379 case ValueRepresentation_SignedShort: // SS (int16_t)
1380 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
1381 case ValueRepresentation_Unknown: // UN
1382 case ValueRepresentation_UnsignedShort: // US (uint16_t)
1383 {
1384 return true;
1385 }
1386
1387 case ValueRepresentation_NotSupported:
1388 default:
1389 throw OrthancException(ErrorCode_ParameterOutOfRange);
1390 }
1391 }
1336 } 1392 }