Skip to content

Scale the FPM object plot by its real-space pixel size, not dxo - #97

Open
tbvanderwoude wants to merge 3 commits into
PtyLab:mainfrom
tbvanderwoude:fix-fpm-object-plot-sampling
Open

Scale the FPM object plot by its real-space pixel size, not dxo#97
tbvanderwoude wants to merge 3 commits into
PtyLab:mainfrom
tbvanderwoude:fix-fpm-object-plot-sampling

Conversation

@tbvanderwoude

@tbvanderwoude tbvanderwoude commented Aug 12, 2026

Copy link
Copy Markdown

Why

While running the FPM tutorial I noticed an apparent mistake in the field of view of the object estimate that is plotted
image
Assuming my calculations are correct, the per-frame field of view is only 288.63 µm, using the detector pixel size of 3.45 um with magnification 1.53 and frame size 128 x 128 px. For FPM, the FOV should remain the same so that this FOV is also displayed in the estimate plot.

What changed

The changes are rather straightforward:

  • The properties dxo_fpm (real-space object size for FPM) and Lo_fpm (single-frame FOV for FPM) were added to Reconstruction
  • In Monitor, updateObjectProbeErrorMonitor was changed to use a new property objectPixelSize which selects dxo for CPM and dxo_fpm for FPM. This ensures the correct physical FOV is displayed also for FPM.

Tests

This PR adds 3 tests, two of which (test_fpm_object_sampling_preserves_field_of_view, test_monitor_plots_fpm_object_with_fpm_pixel_size) verify correct new behavior for FPM, with the other one (test_monitor_plots_cpm_object_with_dxo) a simple regression test for CPM to ensure this behavior is still valid.

Note

I could not find a CONTRIBUTING.md or equivalent so I tried to follow the style of #96 and previous PR's as much as possible. Please let me know if anything is missing that is required to evaluate this change.

I also noticed that for FPM the estimate plot appears to show a pupil but it says 'probe' and has real-space axes. I did not change this but to make this Monitor plot fully correct for FPM this should also be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant