Commit fcbc7ea
feat: add XA Enhanced DICOM support (fixes #31)
Add full support for Siemens syngo MR XA Enhanced DICOM files (XA30, XA60+)
which store protocol data in XProtocol format rather than binary CSA format.
## Changes
### Core Implementation
- Add XA_ENHANCED_TAGS class variable with XA-specific tag definitions
- Add _extract_xa_enhanced_protocol() method to extract XProtocol data
from SharedFunctionalGroupsSequence
- Update from_dicom() to automatically detect and handle both formats:
- Returns CsaHeader for standard binary CSA format
- Returns CsaAsciiHeader for XA Enhanced XProtocol format
- Maintains full backward compatibility
### Tests
- Add comprehensive test suite (23 new tests) in test_xa_enhanced.py
- Test XA Enhanced detection, extraction, and parsing
- Add regression tests for Issue #31
- Verify backward compatibility
- All 223 tests pass (200 existing + 23 new)
- Coverage: 94%
### Test Data
- Add XA30 sample DICOM (syngo MR XA30, MAGNETOM Prisma Fit)
- Add XA60 sample DICOM (syngo MR XA60, MAGNETOM Terra.X)
- Update test fixtures with XA Enhanced file paths
### Documentation
- Update README with XA Enhanced support in features
- Add "Supported DICOM Formats" section
- Add "Working with XA Enhanced DICOMs" usage guide
- Add XA_ENHANCED_ANALYSIS.md with technical details
## Technical Details
XA Enhanced DICOMs store protocol data differently:
- Location: SharedFunctionalGroupsSequence[0][(0x0021,0x10FE)][0][(0x0021,0x1019)]
- Format: XProtocol (ASCII/XML-like) instead of binary CSA
- Already parseable by existing CsaAsciiHeader class
The from_dicom() method now:
1. First tries standard CSA tags (0x0029,0x1010/0x1020)
2. If not found, tries XA Enhanced location
3. Returns appropriate parser (CsaHeader or CsaAsciiHeader)
Closes #31
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent c07e9b9 commit fcbc7ea
7 files changed
Lines changed: 524 additions & 27 deletions
File tree
- csa_header
- tests
- files/xa_enhanced
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
180 | 231 | | |
181 | 232 | | |
182 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
362 | 369 | | |
363 | 370 | | |
364 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
365 | 425 | | |
366 | 426 | | |
367 | 427 | | |
| |||
404 | 464 | | |
405 | 465 | | |
406 | 466 | | |
407 | | - | |
| 467 | + | |
408 | 468 | | |
409 | 469 | | |
410 | 470 | | |
411 | 471 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
415 | 479 | | |
416 | 480 | | |
417 | 481 | | |
| |||
426 | 490 | | |
427 | 491 | | |
428 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
429 | 496 | | |
430 | 497 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
435 | 505 | | |
436 | 506 | | |
437 | 507 | | |
| |||
443 | 513 | | |
444 | 514 | | |
445 | 515 | | |
446 | | - | |
| 516 | + | |
447 | 517 | | |
448 | 518 | | |
449 | | - | |
| 519 | + | |
450 | 520 | | |
451 | 521 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
460 | 529 | | |
461 | 530 | | |
462 | 531 | | |
463 | | - | |
464 | | - | |
| 532 | + | |
465 | 533 | | |
466 | 534 | | |
467 | 535 | | |
468 | 536 | | |
469 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
470 | 541 | | |
471 | 542 | | |
472 | | - | |
| 543 | + | |
| 544 | + | |
473 | 545 | | |
474 | 546 | | |
475 | 547 | | |
| |||
478 | 550 | | |
479 | 551 | | |
480 | 552 | | |
481 | | - | |
| 553 | + | |
482 | 554 | | |
483 | | - | |
484 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
485 | 563 | | |
486 | | - | |
487 | | - | |
| 564 | + | |
| 565 | + | |
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments