DetectorModules: panel look-up by id, plane -> panel, plane bounds and a per-pixel walk; mask size checked
Stage 0 of analysing panel detectors in their stored layout. The table of modules already is the panel table; what the consumers converted in the next stages need from it: - ImageToPlane / PlaneToImage on a known panel, no search; panel -1 (empty table) is the identity. - PlaneToPanel: the panel holding a plane point and its image position, nullopt in a gap (never passed through, unlike the existing PlaneToImage). - PlaneBounds: the box of all panel footprints on the plane; with an empty table exactly the image rectangle today's prediction bounds test uses. - ForEachPixel: f(panel, index, px, py) panel by panel, row by row, gaps not visited; with an empty table the plain row-major loop with plane == image. The image preprocessors (CPU, GPU) and the Bragg engines (CPU, GPU; Metal derives from CPU) now refuse a pixel mask whose size is not the image's, instead of reading a mask of another size out of range. Every reader sizes the experiment's detector, and so the mask, by the image it reads, so nothing that runs today is refused. Nothing calls the new functions yet: no output changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
1 parent
b9ada7914b
commit
a8202789f5
6 files changed
+104
-2
No files matched your search
@@ -329,6 +329,9 @@ ImagePreprocessorGPU::ImagePreprocessorGPU(const DiffractionExperiment &experime
|
||||
copy_image_to_host(copy_image_to_host),
|
||||
gpu_stats(1),
|
||||
cpu_stats(1) {
|
||||
if (mask.GetMask().size() != npixels)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Pixel mask size doesn't match the image");
|
||||
// Setup mask. The byte-per-pixel form and its checksum come from the PixelMask, which derives them
|
||||
// whenever the mask changes: they are the same for every worker, and deriving them walks every
|
||||
// pixel of the detector - 18 million of them on a 16 Mpx one, per engine, with an engine built per
|
||||
|
||||
Reference in new issue
Block a user