comparison Plugins/Engine/PluginsEnumerations.cpp @ 2006:6301bbcbcaed

more generic support of value representations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 Jun 2016 14:48:40 +0200
parents ef1e9856c26f
children 655489d9165d
comparison
equal deleted inserted replaced
2005:9e021b2b348b 2006:6301bbcbcaed
324 throw OrthancException(ErrorCode_ParameterOutOfRange); 324 throw OrthancException(ErrorCode_ParameterOutOfRange);
325 } 325 }
326 } 326 }
327 327
328 328
329 #if !defined(ORTHANC_ENABLE_DCMTK) || ORTHANC_ENABLE_DCMTK != 0 329 ValueRepresentation Convert(OrthancPluginValueRepresentation vr)
330 DcmEVR Convert(OrthancPluginValueRepresentation vr)
331 { 330 {
332 switch (vr) 331 switch (vr)
333 { 332 {
334 case OrthancPluginValueRepresentation_AE: 333 case OrthancPluginValueRepresentation_AE:
335 return EVR_AE; 334 return ValueRepresentation_ApplicationEntity;
336 335
337 case OrthancPluginValueRepresentation_AS: 336 case OrthancPluginValueRepresentation_AS:
338 return EVR_AS; 337 return ValueRepresentation_AgeString;
339 338
340 case OrthancPluginValueRepresentation_AT: 339 case OrthancPluginValueRepresentation_AT:
341 return EVR_AT; 340 return ValueRepresentation_AttributeTag;
342 341
343 case OrthancPluginValueRepresentation_CS: 342 case OrthancPluginValueRepresentation_CS:
344 return EVR_CS; 343 return ValueRepresentation_CodeString;
345 344
346 case OrthancPluginValueRepresentation_DA: 345 case OrthancPluginValueRepresentation_DA:
347 return EVR_DA; 346 return ValueRepresentation_Date;
348 347
349 case OrthancPluginValueRepresentation_DS: 348 case OrthancPluginValueRepresentation_DS:
350 return EVR_DS; 349 return ValueRepresentation_DecimalString;
351 350
352 case OrthancPluginValueRepresentation_DT: 351 case OrthancPluginValueRepresentation_DT:
353 return EVR_DT; 352 return ValueRepresentation_DateTime;
354 353
355 case OrthancPluginValueRepresentation_FD: 354 case OrthancPluginValueRepresentation_FD:
356 return EVR_FD; 355 return ValueRepresentation_FloatingPointDouble;
357 356
358 case OrthancPluginValueRepresentation_FL: 357 case OrthancPluginValueRepresentation_FL:
359 return EVR_FL; 358 return ValueRepresentation_FloatingPointSingle;
360 359
361 case OrthancPluginValueRepresentation_IS: 360 case OrthancPluginValueRepresentation_IS:
362 return EVR_IS; 361 return ValueRepresentation_IntegerString;
363 362
364 case OrthancPluginValueRepresentation_LO: 363 case OrthancPluginValueRepresentation_LO:
365 return EVR_LO; 364 return ValueRepresentation_LongString;
366 365
367 case OrthancPluginValueRepresentation_LT: 366 case OrthancPluginValueRepresentation_LT:
368 return EVR_LT; 367 return ValueRepresentation_LongText;
369 368
370 case OrthancPluginValueRepresentation_OB: 369 case OrthancPluginValueRepresentation_OB:
371 return EVR_OB; 370 return ValueRepresentation_OtherByte;
372 371
373 case OrthancPluginValueRepresentation_OF: 372 case OrthancPluginValueRepresentation_OF:
374 return EVR_OF; 373 return ValueRepresentation_OtherFloat;
375 374
376 case OrthancPluginValueRepresentation_OW: 375 case OrthancPluginValueRepresentation_OW:
377 return EVR_OW; 376 return ValueRepresentation_OtherWord;
378 377
379 case OrthancPluginValueRepresentation_PN: 378 case OrthancPluginValueRepresentation_PN:
380 return EVR_PN; 379 return ValueRepresentation_PatientName;
381 380
382 case OrthancPluginValueRepresentation_SH: 381 case OrthancPluginValueRepresentation_SH:
383 return EVR_SH; 382 return ValueRepresentation_ShortString;
384 383
385 case OrthancPluginValueRepresentation_SL: 384 case OrthancPluginValueRepresentation_SL:
386 return EVR_SL; 385 return ValueRepresentation_SignedLong;
387 386
388 case OrthancPluginValueRepresentation_SQ: 387 case OrthancPluginValueRepresentation_SQ:
389 return EVR_SQ; 388 return ValueRepresentation_Sequence;
390 389
391 case OrthancPluginValueRepresentation_SS: 390 case OrthancPluginValueRepresentation_SS:
392 return EVR_SS; 391 return ValueRepresentation_SignedShort;
393 392
394 case OrthancPluginValueRepresentation_ST: 393 case OrthancPluginValueRepresentation_ST:
395 return EVR_ST; 394 return ValueRepresentation_ShortText;
396 395
397 case OrthancPluginValueRepresentation_TM: 396 case OrthancPluginValueRepresentation_TM:
398 return EVR_TM; 397 return ValueRepresentation_Time;
399 398
400 case OrthancPluginValueRepresentation_UI: 399 case OrthancPluginValueRepresentation_UI:
401 return EVR_UI; 400 return ValueRepresentation_UniqueIdentifier;
402 401
403 case OrthancPluginValueRepresentation_UL: 402 case OrthancPluginValueRepresentation_UL:
404 return EVR_UL; 403 return ValueRepresentation_UnsignedLong;
405 404
406 case OrthancPluginValueRepresentation_UN: 405 case OrthancPluginValueRepresentation_UN:
407 return EVR_UN; 406 return ValueRepresentation_Unknown;
408 407
409 case OrthancPluginValueRepresentation_US: 408 case OrthancPluginValueRepresentation_US:
410 return EVR_US; 409 return ValueRepresentation_UnsignedShort;
411 410
412 case OrthancPluginValueRepresentation_UT: 411 case OrthancPluginValueRepresentation_UT:
413 return EVR_UT; 412 return ValueRepresentation_UnlimitedText;
414 413
415 default: 414 default:
416 throw OrthancException(ErrorCode_ParameterOutOfRange); 415 throw OrthancException(ErrorCode_ParameterOutOfRange);
417 } 416
418 } 417 /*
419 418 Not supported as of DCMTK 3.6.0:
420 419 return ValueRepresentation_OtherDouble
421 OrthancPluginValueRepresentation Convert(DcmEVR vr) 420 return ValueRepresentation_OtherLong
421 return ValueRepresentation_UniversalResource
422 return ValueRepresentation_UnlimitedCharacters
423 */
424 }
425 }
426
427
428 OrthancPluginValueRepresentation Convert(ValueRepresentation vr)
422 { 429 {
423 switch (vr) 430 switch (vr)
424 { 431 {
425 case EVR_AE: 432 case ValueRepresentation_ApplicationEntity:
426 return OrthancPluginValueRepresentation_AE; 433 return OrthancPluginValueRepresentation_AE;
427 434
428 case EVR_AS: 435 case ValueRepresentation_AgeString:
429 return OrthancPluginValueRepresentation_AS; 436 return OrthancPluginValueRepresentation_AS;
430 437
431 case EVR_AT: 438 case ValueRepresentation_AttributeTag:
432 return OrthancPluginValueRepresentation_AT; 439 return OrthancPluginValueRepresentation_AT;
433 440
434 case EVR_CS: 441 case ValueRepresentation_CodeString:
435 return OrthancPluginValueRepresentation_CS; 442 return OrthancPluginValueRepresentation_CS;
436 443
437 case EVR_DA: 444 case ValueRepresentation_Date:
438 return OrthancPluginValueRepresentation_DA; 445 return OrthancPluginValueRepresentation_DA;
439 446
440 case EVR_DS: 447 case ValueRepresentation_DecimalString:
441 return OrthancPluginValueRepresentation_DS; 448 return OrthancPluginValueRepresentation_DS;
442 449
443 case EVR_DT: 450 case ValueRepresentation_DateTime:
444 return OrthancPluginValueRepresentation_DT; 451 return OrthancPluginValueRepresentation_DT;
445 452
446 case EVR_FD: 453 case ValueRepresentation_FloatingPointDouble:
447 return OrthancPluginValueRepresentation_FD; 454 return OrthancPluginValueRepresentation_FD;
448 455
449 case EVR_FL: 456 case ValueRepresentation_FloatingPointSingle:
450 return OrthancPluginValueRepresentation_FL; 457 return OrthancPluginValueRepresentation_FL;
451 458
452 case EVR_IS: 459 case ValueRepresentation_IntegerString:
453 return OrthancPluginValueRepresentation_IS; 460 return OrthancPluginValueRepresentation_IS;
454 461
455 case EVR_LO: 462 case ValueRepresentation_LongString:
456 return OrthancPluginValueRepresentation_LO; 463 return OrthancPluginValueRepresentation_LO;
457 464
458 case EVR_LT: 465 case ValueRepresentation_LongText:
459 return OrthancPluginValueRepresentation_LT; 466 return OrthancPluginValueRepresentation_LT;
460 467
461 case EVR_OB: 468 case ValueRepresentation_OtherByte:
462 return OrthancPluginValueRepresentation_OB; 469 return OrthancPluginValueRepresentation_OB;
463 470
464 case EVR_OF: 471 case ValueRepresentation_OtherFloat:
465 return OrthancPluginValueRepresentation_OF; 472 return OrthancPluginValueRepresentation_OF;
466 473
467 case EVR_OW: 474 case ValueRepresentation_OtherWord:
468 return OrthancPluginValueRepresentation_OW; 475 return OrthancPluginValueRepresentation_OW;
469 476
470 case EVR_PN: 477 case ValueRepresentation_PatientName:
471 return OrthancPluginValueRepresentation_PN; 478 return OrthancPluginValueRepresentation_PN;
472 479
473 case EVR_SH: 480 case ValueRepresentation_ShortString:
474 return OrthancPluginValueRepresentation_SH; 481 return OrthancPluginValueRepresentation_SH;
475 482
476 case EVR_SL: 483 case ValueRepresentation_SignedLong:
477 return OrthancPluginValueRepresentation_SL; 484 return OrthancPluginValueRepresentation_SL;
478 485
479 case EVR_SQ: 486 case ValueRepresentation_Sequence:
480 return OrthancPluginValueRepresentation_SQ; 487 return OrthancPluginValueRepresentation_SQ;
481 488
482 case EVR_SS: 489 case ValueRepresentation_SignedShort:
483 return OrthancPluginValueRepresentation_SS; 490 return OrthancPluginValueRepresentation_SS;
484 491
485 case EVR_ST: 492 case ValueRepresentation_ShortText:
486 return OrthancPluginValueRepresentation_ST; 493 return OrthancPluginValueRepresentation_ST;
487 494
488 case EVR_TM: 495 case ValueRepresentation_Time:
489 return OrthancPluginValueRepresentation_TM; 496 return OrthancPluginValueRepresentation_TM;
490 497
491 case EVR_UI: 498 case ValueRepresentation_UniqueIdentifier:
492 return OrthancPluginValueRepresentation_UI; 499 return OrthancPluginValueRepresentation_UI;
493 500
494 case EVR_UL: 501 case ValueRepresentation_UnsignedLong:
495 return OrthancPluginValueRepresentation_UL; 502 return OrthancPluginValueRepresentation_UL;
496 503
497 case EVR_US: 504 case ValueRepresentation_UnsignedShort:
498 return OrthancPluginValueRepresentation_US; 505 return OrthancPluginValueRepresentation_US;
499 506
500 case EVR_UT: 507 case ValueRepresentation_UnlimitedText:
501 return OrthancPluginValueRepresentation_UT; 508 return OrthancPluginValueRepresentation_UT;
502 509
503 case EVR_UN: 510 case ValueRepresentation_Unknown:
504 default:
505 return OrthancPluginValueRepresentation_UN; // Unknown 511 return OrthancPluginValueRepresentation_UN; // Unknown
506 } 512
507 } 513 // These VR are not supported as of DCMTK 3.6.0, so they are
508 #endif 514 // mapped to "UN" (unknown) VR in the plugins
515 case ValueRepresentation_OtherDouble:
516 case ValueRepresentation_OtherLong:
517 case ValueRepresentation_UniversalResource:
518 case ValueRepresentation_UnlimitedCharacters:
519 return OrthancPluginValueRepresentation_UN;
520
521 default:
522 throw OrthancException(ErrorCode_ParameterOutOfRange);
523 }
524 }
509 } 525 }
510 } 526 }