Add multidimensional drift correction and strip-based alignment - EDS, 4DSTEM prior to arXiv - #283
Open
bobleesj wants to merge 12 commits into
Open
Add multidimensional drift correction and strip-based alignment - EDS, 4DSTEM prior to arXiv #283bobleesj wants to merge 12 commits into
bobleesj wants to merge 12 commits into
Conversation
refactor: split drift into a package without behavior changes
* feat: add drift registration diagnostics * feat: add structured drift reports * feat: add static drift diagnostic plots * test: validate drift diagnostics on frozen results * fix: keep drift diagnostics consistent with fitted state
* feat: add reference-based spectrum-image correction * fix: reject ambiguous spectrum-image reference matches
* feat: add reference-based spectrum-image correction * fix: reject ambiguous spectrum-image reference matches * feat: propagate drift across 4D-STEM scan axes * test: protect 4D-STEM detector coordinates * test: compare full detector signature field * test: verify 4D-STEM coverage and output residency * fix: stream native 4D-STEM scan correction * test: compare native detector frames across backends * test: set float32 backend parity tolerance
* feat: add reference-based spectrum-image correction * fix: reject ambiguous spectrum-image reference matches * feat: propagate drift across 4D-STEM scan axes * test: protect 4D-STEM detector coordinates * test: compare full detector signature field * test: verify 4D-STEM coverage and output residency * fix: stream native 4D-STEM scan correction * test: compare native detector frames across backends * test: set float32 backend parity tolerance * feat: preserve calibration during drift downsampling * test: lock downsampled coordinate provenance * perf: add average-pooled affine pyramid search * test: compare native and pyramid affine rates * feat: add strip-wise residual correction primitives * fix: make nonrigid regularization portable across torch backends * feat: propagate residual fields to calibrated element maps * test: lock residual-correction publication contracts * test: recover known strip residual shifts * feat: complete automatic affine manuscript parity * feat: complete multi-knot manuscript parity * test: verify complete manuscript workflow parity * fix: keep 4D-STEM integration usable without optional GPU package * refactor: adopt the scientist-facing Drift API * test: verify manuscript output frame contracts * fix: preserve natural corrected output frames * feat: expose manual translation alignment
Collaborator
Author
|
@wwmills ready for review. If you agree with the API proposed and folder architecture, we can probably merge so that you can add your new algo as needed and refactor with upcoming PRs. This PR is to enable further scaling of features and reproduce manuscript results. |
bobleesj
marked this pull request as ready for review
August 26, 2026 17:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem this PR addreseses
Support 3D, 4DSTEM drift correction.
PRs broken down as shown below:
Before
After
Public API change
from_data(...)from_images(...)align_translation()align_affine()correct_affine()align_nonrigid()correct_nonrigid()generate_corrected()corrected()number_knots,stepnum_knots,max_drift_rateAffine speed:
The pyramid downsampling strategy enables real-time drift correction on any personal laptops.
What should the reviewer(s) do
Tutorials are available here: https://github.com/bobleesj/quantem-tutorials/tree/drift-tutorial/tutorials/imaging/drift
.