Commit 2096f8c
committed
ultrasound: extract unitToMm helper, document unit codes per spec
Per DICOM PS3.3 C.8.5.5.1.15, code 3 (cm) is the only spatial spacing
unit defined for PhysicalUnitsXDirection / YDirection — codes 0, 1, 2,
4–10 cover none / percent / dB / seconds / hertz / dB/sec / cm/sec /
cm² / cm²/sec / degrees. Replace the strict cm equality check with a
unitToMm helper that returns 10 for cm and null for everything else,
applied per axis. Functionally equivalent to the previous strict check,
but isolates the unit-to-spacing mapping in one tested place and adds a
clear extension point if a vendor exception ever needs to be honoured.1 parent 55eb9bb commit 2096f8c
3 files changed
Lines changed: 35 additions & 12 deletions
File tree
- src/core/streaming
- dicom
- __tests__
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 294 | | |
301 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
302 | 299 | | |
303 | 300 | | |
304 | | - | |
305 | | - | |
| 301 | + | |
| 302 | + | |
306 | 303 | | |
307 | 304 | | |
308 | 305 | | |
| |||
0 commit comments