Add a Measurements reference tab to the in-app help#43
Merged
Conversation
The backend align_rows supports median, mean, and linear (linear also removes a straight slope within each row), and the Definitions help documents all three — but the GUI's "Align rows" dropdown only offered None/Median/Mean, so the documented 'linear' option was unreachable. Add "Linear" to the Align rows control (probeflow/gui/processing.py: combo items, state align_map, set_state reverse map, tooltip) and to the menu-bar mirror (probeflow/gui/dialogs/image_viewer_chrome_mixin.py). The state→op pipeline already passes the method through generically, so linear works end to end. Test: test_align_rows_exposes_linear_option. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Definitions dialog explained processing, ROIs, and how-tos but said nothing about the measurements a user can take. Add a student-friendly Measurements reference covering the image measurements, in the same format as the rest (plain-language summary, an "In practice" lead, the exact formula, cautions). - New _MEASUREMENT_ENTRIES + render_measurements_html + _MeasurementsPanel in probeflow/gui/dialogs/definitions.py: ten entries — Distance, Angle, Line profile (and Δ), Line periodicity, ROI statistics, Step height, Feature maxima, Point mask / FFT, Pair correlation, Feature → lattice. Each formula was read from its source module so the maths matches the code (e.g. step height = mean_b − mean_a; RMS roughness = sqrt(mean((z−mean)²)); g(r) with edge correction; lattice RMS displacement). - New "Measurements" tab between Processing and ROI Actions; _TAB_INDEX and set_reference_tab updated. - Reachable from Help menu + command finder: new help.measurements ViewerCommand (shortcuts.py), Help-menu action (image_viewer_chrome_mixin.py), and _show_viewer_measurements opening the tab (image_viewer_toolbar_mixin.py). Scope: image measurements only (excludes spectroscopy Spectrum Δ). Tests: test_measurements_reference_has_entries_and_formulas; tab-focus and command-finder tests extended for measurements. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up to the Measurements reference, addressing two review notes: - Advanced Edge Detection was undocumented. Add a Processing-reference entry "Advanced edge detection (Canny / Sobel–Scharr)" describing the Process-tab tool: Canny (Gaussian smoothing, non-maximum suppression, hysteresis with percentile/absolute low/high thresholds) and Sobel/Scharr gradient (magnitude / x / y / orientation, optional threshold-to-mask), plus the overlay / new-image / mask / ROI outputs and presets. Equations read from probeflow/processing/edge_detection.py. - The line tool is both a measurement and an ROI. Cross-reference it both ways: the Measurements "Line profile (and Δ)" entry points to "Line ROI actions" (ROI Actions tab) for drawing/editing/width and notes Distance/Angle also use line ROIs; "Line ROI actions" points to the Measurements tab for the readouts. Tests extended: assert the Advanced edge detection entry (hysteresis, Sobel/Scharr) and the line-tool cross-reference render. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The Definitions dialog covered Processing, ROI Actions, and How-to but had nothing on the measurements. Adds a student-friendly Measurements tab covering the image measurements, in the same format as the rest (plain-English summary → "In practice" lead → exact formula → cautions).
Ten entries: Distance, Angle, Line profile (and Δ), Line periodicity, ROI statistics, Step height, Feature maxima, Point mask/FFT, Pair correlation, Feature → lattice.
Each formula was read from its source module so the maths matches the code:
analysis/simple_measurements.pyrms_roughness = sqrt(mean((z−mean)²))) and Step height (height_difference = mean_b − mean_a) —measurements/image.pyanalysis/pair_correlation.pyanalysis/feature_lattice.pymeasurements/fft_points.py; Feature maxima —analysis/feature_finder.py; Line periodicity —analysis/line_periodicity.pyWiring
_TAB_INDEX+set_reference_tabupdated).help.measurementscommand, Help-menu action, and_show_viewer_measurementsopening the tab. (Scope per request: image measurements only — no Spectrum Δ.)Tests
test_measurements_reference_has_entries_and_formulas(10 equation blocks + 10 "In practice" leads + pinned formulas); tab-focus and command-finder tests extended. 74 tests green across the affected suites;ruffclean.🤖 Generated with Claude Code