Skip to content

Let "Align by correlation" record its shift and propagate across a range of sections #95

Description

@dustenhubbard

Problem

Align by correlation (Ctrl+\) aligns the current section to the previously viewed section, but the shift it computes cannot be recorded and reapplied across a range of sections. Aligning a stack means repeating the correlation section by section.

Proposed

Let the correlation alignment record its computed shift and propagate it across a chosen range of sections, the same way a manual transform can be propagated.

Notes

corrAlign (in PyReconstruct/modules/gui/main/field_widget_4_data.py, bound to Ctrl+\) computes an FFT cross-correlation shift and applies it to the current section only, setting section.tform directly. A propagation mechanism already exists in the same file (setPropagationMode / stored_tform / propagateTo) that records a transform change and replays it across a range; routing the correlation shift through that recording path (via changeTform) would satisfy this.

Related correctness fix to make alongside this: corrAlign composes its shift as shift_tform * tform, but the field-space shift should be applied after the existing transform (tform * shift_tform). The current order produces incorrect alignment whenever the section transform already has rotation or scale; pure translations happen to commute, which is why it has gone unnoticed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions