From abf156a3aa62af0b73baa72f32fdcda486c4dc18 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 31 Jul 2026 14:40:17 +0200 Subject: [PATCH] CBOR: carry ice_ring_score in the END block The per-image ice ring score was encoded for every DataMessage but never for the END message, although docs/CBOR.md has always listed it there and both NXmx::EndResultVectors and HDF5MetadataSource expect it. Any dataset written over the stream therefore had no /entry/MX/iceRingScore, and under NXmxIntegrated - where the whole-run vector is the only copy - the score was lost entirely. Co-Authored-By: Claude Opus 5 (1M context) --- frame_serialize/CBORStream2Deserializer.cpp | 2 ++ frame_serialize/CBORStream2Serializer.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/frame_serialize/CBORStream2Deserializer.cpp b/frame_serialize/CBORStream2Deserializer.cpp index 14642a35..2593d9ee 100644 --- a/frame_serialize/CBORStream2Deserializer.cpp +++ b/frame_serialize/CBORStream2Deserializer.cpp @@ -1425,6 +1425,8 @@ namespace { GetCBORUInt8Array(value, message.image_indexed); else if (key == "v_bkg_estimate") GetCBORFloatArray(value, message.v_bkg_estimate); + else if (key == "ice_ring_score") + GetCBORFloatArray(value, message.ice_ring_score); else if (key == "profile_radius") GetCBORFloatArray(value, message.profile_radius); else if (key == "mosaicity") diff --git a/frame_serialize/CBORStream2Serializer.cpp b/frame_serialize/CBORStream2Serializer.cpp index 813bedf7..229b8510 100644 --- a/frame_serialize/CBORStream2Serializer.cpp +++ b/frame_serialize/CBORStream2Serializer.cpp @@ -773,6 +773,7 @@ void CBORStream2Serializer::SerializeSequenceEnd(const EndMessage& message) { CBOR_ENC(mapEncoder, "spot_count_indexed", message.spot_count_indexed); CBOR_ENC(mapEncoder, "image_indexed", message.image_indexed); CBOR_ENC(mapEncoder, "v_bkg_estimate", message.v_bkg_estimate); + CBOR_ENC(mapEncoder, "ice_ring_score", message.ice_ring_score); CBOR_ENC(mapEncoder, "profile_radius", message.profile_radius); CBOR_ENC(mapEncoder, "mosaicity", message.mosaicity); CBOR_ENC(mapEncoder, "bFactor", message.bFactor);