Merge rc167 into the detection-score branch
Both lanes added a per-image scalar to the same eleven files, so every conflict was two
additions competing for one line. All were resolved by keeping both, with three that needed
more than that:
- ScanResultGenerator: rc167 changed the per-image float vectors to resize(n, NAN) so a frame
that never arrived does not read back as a real 0. v_protein_score and v_ice_score are exactly
that case - 0 is a real answer ("nothing detected here") - so they take the NAN default too.
- HDF5MetadataSource: rc167 established that NaN in a stored per-image array means "no value" and
the optional must come back absent. The two detection scores now follow it, which they did not
before the merge; without the guard a missing score would come back as a NaN that a threshold
would silently compare against.
- CBORTest: designated initialisers must follow member declaration order, so spindle_blind_fraction
precedes the two scores in the DataMessage aggregate.
Verified after the merge that every CBOR key that is encoded is also decoded (198 encoded keys,
one intentional exception: the "type" discriminator), that both lanes' fields survive in the
writer, the reader, the plots and the API, and that a stored file still round-trips.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
@@ -56,6 +56,7 @@ void HDF5DataFilePluginMX::OpenFile(HDF5File &data_file, const DataMessage &msg,
|
||||
ice_ring_score.reserve(images_per_file);
|
||||
protein_score.reserve(images_per_file);
|
||||
ice_score.reserve(images_per_file);
|
||||
spindle_blind_fraction.reserve(images_per_file);
|
||||
|
||||
if (max_spots == 0)
|
||||
return;
|
||||
@@ -107,6 +108,8 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
|
||||
protein_score[image_number] = msg.protein_score.value();
|
||||
if (msg.ice_score.has_value())
|
||||
ice_score[image_number] = msg.ice_score.value();
|
||||
if (msg.spindle_blind_fraction.has_value())
|
||||
spindle_blind_fraction[image_number] = msg.spindle_blind_fraction.value();
|
||||
|
||||
if (max_spots == 0)
|
||||
return;
|
||||
@@ -262,6 +265,8 @@ void HDF5DataFilePluginMX::WriteFinal(HDF5File &data_file) {
|
||||
data_file.SaveVector("/entry/MX/proteinScore", protein_score.vec());
|
||||
if (!ice_score.empty())
|
||||
data_file.SaveVector("/entry/MX/iceScore", ice_score.vec());
|
||||
if (!spindle_blind_fraction.empty())
|
||||
data_file.SaveVector("/entry/MX/spindleBlindFraction", spindle_blind_fraction.vec());
|
||||
if (!profile_radius.empty())
|
||||
data_file.SaveVector("/entry/MX/profileRadius", profile_radius.vec())->Units("Angstrom^-1");
|
||||
if (!mosaicity_deg.empty())
|
||||
|
||||
Reference in New Issue
Block a user