From 0bd60896c15c96f3ba0e59be6b759e460f220563 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 23 Oct 2026 07:49:00 +0200 Subject: [PATCH] MXAnalysisAfterFPGA: the Bragg engine's edge mask in the image's layout, so raw / untransformed FPGA runs start again The FPGA path built its CPU Bragg engine with PixelMask(experiment), which is always in the converted (transformed) layout. With Raw() or GeometryTransformation(false) the image is in the raw layout, so the mask was larger than the image - read out of place, but silently. a8202789f made the Bragg engine refuse a mask whose size is not the image's, so every FrameTransformationThread threw "Pixel mask size doesn't match the image" at setup, the collection was cancelled and no image reached the pusher (9 unit tests: JFJochReceiverTest_Raw/_PacketLost_Raw/_EIGER/_Conversion_NoGeomTransform, HDF5FilePusher_Raw and the StreamWriterTest_ZMQ family). The mask is now taken with GetMask(experiment), i.e. the raw-layout copy when the geometry is not transformed; unchanged for transformed runs. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu --- image_analysis/MXAnalysisAfterFPGA.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/image_analysis/MXAnalysisAfterFPGA.cpp b/image_analysis/MXAnalysisAfterFPGA.cpp index f92a009cd..c90597936 100644 --- a/image_analysis/MXAnalysisAfterFPGA.cpp +++ b/image_analysis/MXAnalysisAfterFPGA.cpp @@ -37,8 +37,10 @@ MXAnalysisAfterFPGA::MXAnalysisAfterFPGA(const DiffractionExperiment &in_experim indexer(indexer), prediction(CreateBraggPrediction(experiment.IsRotationIndexing())), // No pixel mask reaches this path: the FPGA image marks its own masked pixels, so only a - // saturated pixel is read as an overload here. - bragg_engine(std::make_unique(in_experiment, PixelMask(in_experiment))) { + // saturated pixel is read as an overload here. The edge mask is taken in the image's own layout, + // which is the raw one when the geometry is not transformed. + bragg_engine(std::make_unique( + in_experiment, PixelMask(PixelMask(in_experiment).GetMask(in_experiment)))) { if (experiment.IsSpotFindingEnabled()) find_spots = true;