image analysis: two per-image detection scores say whether there is protein and whether there is ice
proteinScore and iceScore are saturating scores in [0,1] that answer presence, not quality: a superb crystal and a barely-diffracting one both read near 1, and neither the spot count nor the resolution enters either of them as a term. iceRingScore already reports a magnitude - a ratio, unbounded - which is not a number that can be thresholded; these are. The protein score counts distinct d SHELLS above 5 A rather than spots, so a parasitic ring in the low-resolution band cannot accumulate evidence, and weights each spot against the frame's own median so a scattering of the weakest detections cannot fill a shell either. The ice score carries two channels and takes the stronger: a radial one over the azimuthal profile, which runs the hexagonal and the CUBIC phase as separate hypotheses and decides between them at the end (flash-cooled loops show cubic or stacking-disordered ice at least as often as hexagonal, the two share only three lines, and dropping the cubic hypothesis costs about 5 pp on iced loops), and a spot one that reads an excess on the ice radii against the same band slid to every ice-free offset, which is what catches ice arriving as discrete crystallites and leaving the radial profile flat. Both read d out of the geometry, so both move with a beam-centre error; the centre is not fitted here, and the one they were computed with is written beside them as scoreBeamCenterX/Y so a later rescoring can tell an algorithm disagreement from a geometry one. Ported from validated prototypes and checked against them frame by frame on stored data: mean absolute difference 2.7e-5 (protein), 1.3e-8 (ice radial) and 3.4e-4 (ice spots). On a 41-loop battery the protein score reaches 98.4% of confirmed-protein frames and 0.00% of water frames, and finds no cluster on any water or ice raster. Cost is 0.01 ms/frame for the protein score and 0.08-0.32 ms/frame for the ice score. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
@@ -558,6 +558,10 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
dataset->indexing_result = master_file->ReadOptVector<float>("/entry/MX/imageIndexed");
|
||||
dataset->bkg_estimate = master_file->ReadOptVector<float>("/entry/MX/bkgEstimate");
|
||||
dataset->ice_ring_score = master_file->ReadOptVector<float>("/entry/MX/iceRingScore");
|
||||
dataset->protein_score = master_file->ReadOptVector<float>("/entry/MX/proteinScore");
|
||||
dataset->ice_score = master_file->ReadOptVector<float>("/entry/MX/iceScore");
|
||||
dataset->score_beam_center_x = master_file->GetOptFloat("/entry/MX/scoreBeamCenterX");
|
||||
dataset->score_beam_center_y = master_file->GetOptFloat("/entry/MX/scoreBeamCenterY");
|
||||
dataset->resolution_estimate = master_file->ReadOptVector<float>("/entry/MX/resolutionEstimate");
|
||||
dataset->profile_radius = master_file->ReadOptVector<float>("/entry/MX/profileRadius");
|
||||
// Master files write indexedLatticeCount; data files / the per-file MX
|
||||
@@ -704,6 +708,14 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
data_file, "/entry/MX/iceRingScore",
|
||||
number_of_images, fimages);
|
||||
|
||||
ReadVector(dataset->protein_score,
|
||||
data_file, "/entry/MX/proteinScore",
|
||||
number_of_images, fimages);
|
||||
|
||||
ReadVector(dataset->ice_score,
|
||||
data_file, "/entry/MX/iceScore",
|
||||
number_of_images, fimages);
|
||||
|
||||
ReadVector(dataset->profile_radius,
|
||||
data_file, "/entry/MX/profileRadius",
|
||||
number_of_images, fimages);
|
||||
@@ -1329,6 +1341,10 @@ void HDF5MetadataSource::FillPerImage(DataMessage &message, int64_t requested_im
|
||||
message.bkg_estimate = dataset->bkg_estimate[image_number];
|
||||
if (dataset->ice_ring_score.size() > image_number)
|
||||
message.ice_ring_score = dataset->ice_ring_score[image_number];
|
||||
if (dataset->protein_score.size() > image_number)
|
||||
message.protein_score = dataset->protein_score[image_number];
|
||||
if (dataset->ice_score.size() > image_number)
|
||||
message.ice_score = dataset->ice_score[image_number];
|
||||
if (dataset->efficiency.size() > image_number)
|
||||
message.image_collection_efficiency = dataset->efficiency[image_number];
|
||||
if (dataset->profile_radius.size() > image_number)
|
||||
|
||||
Reference in New Issue
Block a user