Skip to content

Rename Display Pyramid to Pyramidal Downsampling and align pyramid outputs#13

Merged
AdvancedImagingUTSW merged 4 commits intomainfrom
3d-registration-pipeline
Mar 22, 2026
Merged

Rename Display Pyramid to Pyramidal Downsampling and align pyramid outputs#13
AdvancedImagingUTSW merged 4 commits intomainfrom
3d-registration-pipeline

Conversation

@AdvancedImagingUTSW
Copy link
Contributor

@AdvancedImagingUTSW AdvancedImagingUTSW commented Mar 21, 2026

Summary

  • rename the user-facing "Display Pyramid" operation to "Pyramidal Downsampling"
  • move pyramidal downsampling into preprocessing order between Shearing and Registration
  • update registration GUI controls to show only valid source-aware channel/resolution options
  • hide anchor tile controls unless global optimization is set to manual anchor mode
  • write non-data pyramids adjacent to the source component (<source>_pyramid/level_n) and rebuild legacy layouts when needed
  • run Black formatting across the repository
  • Implemented the 3D registration workflow in pipeline.py, wired it into runtime execution in main.py, and extended normalization/defaults in workflow.py. The new path does pairwise overlap-only 3D registration, central/manual anchor selection, global solve with pruning, full-resolution fusion with feather or average blending, and writes the registration metadata datasets under results/registration/latest.
  • The GUI work is in app.py. Registration is now under Preprocessing, has real controls for channel, transform type, resolution level, anchor mode/position, overlap padding, and blend mode, and those values round-trip into the workflow config.

Validation

  • uv run --with requests --with pytest python -m pytest tests/gui/test_gui_execution.py tests/visualization/test_pipeline.py tests/registration/test_pipeline.py tests/test_workflow.py
  • uv run black .
  • uv run ruff check src/clearex/gui/app.py src/clearex/visualization/pipeline.py src/clearex/workflow.py tests/gui/test_gui_execution.py tests/visualization/test_pipeline.py tests/registration/test_pipeline.py tests/test_workflow.py

Copilot AI review requested due to automatic review settings March 21, 2026 21:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Clearex’s analysis pipeline and UI to rename/relayout the “Display Pyramid” operation (now “Pyramidal Downsampling”), integrates a new canonical 6D registration workflow, and migrates display-pyramid outputs to source-adjacent component layouts while applying repo-wide Black formatting.

Changes:

  • Renames “Display Pyramid” to “Pyramidal Downsampling”, moves it earlier in preprocessing, and migrates pyramid outputs to <source>_pyramid/level_n (with legacy rebuild behavior).
  • Adds a new clearex.registration.pipeline implementation and wires registration execution into main.py, workflow defaults/normalization, and GUI controls.
  • Updates GUI to present source-aware registration channel/resolution options and hides manual-anchor controls unless needed; refreshes/extends test coverage accordingly.

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/visualization/test_pipeline.py Updates display-pyramid assertions and adds legacy-layout rebuild test.
tests/usegment3d/test_pipeline.py Black formatting adjustment.
tests/test_workflow.py Updates default orders, adds registration parameter normalization/validation tests, adds registration alias test.
tests/test_main.py Updates workflow execution tests for registration Dask workload and chaining registration → visualization.
tests/shear/test_pipeline.py Black formatting adjustments.
tests/segmentation/test_pointsource.py Formats particle import list.
tests/segmentation/init.py Removes trailing whitespace line.
tests/registration/test_pipeline.py Adds new registration pipeline unit/integration tests.
tests/registration/test_image_registration.py Black formatting adjustments.
tests/mip_export/test_pipeline.py Black formatting adjustments.
tests/io/test_read.py Removes blank line.
tests/io/test_provenance.py Black formatting adjustments.
tests/io/test_experiment.py Black formatting adjustments.
tests/gui/test_gui_execution.py Adds GUI tests for registration tab placement, persistence, source-aware options, and anchor visibility; updates label text.
tests/flatfield/test_pipeline.py Black formatting adjustments.
tests/conftest.py Removes blank line.
tests/init.py Black formatting adjustments.
src/clearex/workflow.py Reorders operations, adds registration alias/output mapping, adds registration parameter normalization.
src/clearex/visualization/pipeline.py Moves display pyramid storage to source-adjacent layout and adds legacy-layout detection/rebuild.
src/clearex/usegment3d/pipeline.py Minor string formatting change.
src/clearex/stats/init.py Trailing whitespace/format cleanup.
src/clearex/shear/pipeline.py Typing import formatting + minor string formatting change.
src/clearex/shear/init.py Removes trailing whitespace line.
src/clearex/segmentation/pointsource.py Formats particle import list.
src/clearex/registration/tre.py Removes blank line.
src/clearex/registration/pipeline.py Adds new canonical 6D registration analysis pipeline implementation.
src/clearex/preprocess/pad.py Simplifies tuple unpacking.
src/clearex/mip_export/pipeline.py Black formatting adjustments.
src/clearex/main.py Integrates registration into workflow execution and provenance outputs; adds import fallback.
src/clearex/io/provenance.py Black formatting adjustments.
src/clearex/io/log.py Removes blank line.
src/clearex/io/experiment.py Black formatting adjustments.
src/clearex/gui/app.py Adds registration UI controls, source-aware channel/resolution discovery, tab/order updates, and label rename.
src/clearex/flatfield/pipeline.py Black formatting adjustments.
src/clearex/filter/kernels.py Simplifies tuple unpacking.
src/clearex/filter/filters.py Docstring/spacing cleanup.
src/clearex/filter/init.py Removes trailing whitespace line.
src/clearex/file_operations/init.py Removes trailing whitespace line.
src/clearex/detect/pipeline.py Black formatting adjustments.
src/clearex/context/init.py Removes trailing whitespace line.
setup.py Removes blank line.
examples/scripts/registration/register_round_function.py Removes trailing whitespace line.
examples/scripts/registration/image_registration_class.py Removes trailing whitespace line.
docs/source/conf.py Removes blank line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Registration channel and resolution options are rebuilt in-place.
"""
self._refresh_registration_channel_options()
self._refresh_registration_channel_options()
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_on_registration_input_source_changed calls _refresh_registration_channel_options() twice. This is redundant at best and can cause unnecessary Zarr reads/UI churn. Remove the duplicate call so the handler refreshes channels once and then refreshes resolution levels.

Suggested change
self._refresh_registration_channel_options()

Copilot uses AI. Check for mistakes.
@@ -11233,6 +11846,8 @@ def _refresh_input_source_options(self) -> None:
combo.setEnabled(self._operation_checkboxes[operation_name].isChecked())
combo.blockSignals(False)

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_refresh_input_source_options rebuilds the registration input-source combo under blocked signals, but only refreshes resolution-level options afterward. The registration channel combo can become stale/invalid when the input source changes via this refresh. Consider also calling _refresh_registration_channel_options() here (ideally before resolution levels) to keep both controls consistent with the selected source.

Suggested change
self._refresh_registration_channel_options()

Copilot uses AI. Check for mistakes.
Comment on lines +1349 to +1352
)
weight_volume = _blend_weight_volume(
source_volume.shape, blend_mode=blend_mode, overlap_zyx=overlap_zyx
)
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In _process_and_write_registration_chunk, weight_volume = _blend_weight_volume(...) is recomputed inside the per-position loop even though it depends only on the tile shape, blend_mode, and overlap_zyx (which are constant for all positions). This adds significant overhead for every output chunk. Precompute weight_volume once outside the loop and reuse it for each position.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 56.91120% with 558 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.05%. Comparing base (4aa8805) to head (8abebea).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/clearex/gui/app.py 1.43% 344 Missing ⚠️
src/clearex/registration/pipeline.py 76.37% 172 Missing ⚠️
src/clearex/visualization/pipeline.py 84.84% 15 Missing ⚠️
src/clearex/main.py 60.00% 10 Missing ⚠️
src/clearex/workflow.py 87.80% 5 Missing ⚠️
src/clearex/flatfield/pipeline.py 81.81% 4 Missing ⚠️
src/clearex/mip_export/pipeline.py 40.00% 3 Missing ⚠️
src/clearex/filter/kernels.py 0.00% 1 Missing ⚠️
src/clearex/io/experiment.py 91.66% 1 Missing ⚠️
src/clearex/preprocess/pad.py 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   48.50%   49.05%   +0.55%     
==========================================
  Files          49       50       +1     
  Lines       16173    17377    +1204     
==========================================
+ Hits         7844     8525     +681     
- Misses       8329     8852     +523     
Flag Coverage Δ
unittests 49.05% <56.91%> (+0.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdvancedImagingUTSW AdvancedImagingUTSW merged commit 647b58a into main Mar 22, 2026
5 checks passed
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.

2 participants