view Database/2026-03-16-OD-OF-OL.txt @ 942:d1259f584f1e default tip

merge
author Alain Mazy <am@orthanc.team>
date Fri, 17 Jul 2026 15:05:44 +0200
parents d7670ddcedab
children
line wrap: on
line source

The file "2026-03-16-OF-OD.dcm" was generated as follows:

# python3 << EOF
import struct

od_values = [1.1, 2.2, 3.3]
of_values = [10.1, 20.2, 30.3]
ol_values = [42, 0, 15]

with open("/tmp/od.bin", "wb") as f:
    for v in od_values:
        f.write(struct.pack("<d", v))  # little-endian float binary64

with open("/tmp/of.bin", "wb") as f:
    for v in of_values:
        f.write(struct.pack("<f", v))  # little-endian float binary32

with open("/tmp/ol.bin", "wb") as f:
    for v in ol_values:
        f.write(struct.pack("<I", v))  # little-endian uint32
EOF

# cp DummyCT.dcm 2026-03-16-OD-OF-OL.dcm && \
  dcmodify --no-backup -gin \
           -if "(0070,150D)=/tmp/od.bin" \
           -if "(0066,0016)=/tmp/of.bin" \
           -if "(0066,0041)=/tmp/ol.bin" \
           2026-03-16-OD-OF-OL.dcm