Commit f707a63
MRIFiles: fix waveformName/waveformType parsed as Float64 instead of String (#292)
* MRIFiles: fix waveformName/waveformType parsed as Float64 instead of String
waveformInformation fields waveformName and waveformType are XML strings
(waveformType is an enum: ECG, NOISE, GADGETRON_TRIGGER, …). They were
incorrectly typed as Float64 in addToDict!, causing
ArgumentError: cannot parse "ECG" as Float64
for any ISMRMRD file containing a waveformInformation block.
Also fixes a pre-existing test bug in the spiral-data section where
write(IOBuffer(), ...) discarded writes to anonymous buffers instead of
writing to the named io/ioCopy buffers under test.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* MRIFiles: parse all waveformInformation entries as a list
The ISMRMRD schema allows up to 32 waveformInformation elements per
header (maxOccurs="32"). The previous code only read e[1], silently
discarding all but the first, and the write path emitted at most one
element. Both read and write now handle an arbitrary number of entries.
Read: all waveformInformation elements are collected into
params["waveformInformation"] as a Vector{Dict{String,Any}}, each dict
holding waveformName, waveformType, and optionally userParameters.
Write: each entry in the vector produces its own <waveformInformation>
element in the output XML.
The old flat keys waveformName, waveformType, and waveformUserParameters
are replaced by the structured list.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f6d2e25 commit f707a63
2 files changed
Lines changed: 53 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| |||
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
208 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
209 | 215 | | |
| 216 | + | |
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
| |||
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
397 | | - | |
398 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
399 | 412 | | |
400 | 413 | | |
401 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 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 | + | |
52 | 78 | | |
53 | 79 | | |
54 | 80 | | |
| |||
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | | - | |
| 110 | + | |
85 | 111 | | |
86 | | - | |
87 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
88 | 116 | | |
89 | 117 | | |
90 | 118 | | |
| |||
0 commit comments