Skip to content

fix #330: PolySelection.export_high_res_area not working when 'add' button is not clicked#440

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursorstereopy-issue-handling-10a5
Draft

fix #330: PolySelection.export_high_res_area not working when 'add' button is not clicked#440
cursor[bot] wants to merge 1 commit intomainfrom
cursorstereopy-issue-handling-10a5

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 2, 2026

Summary

PolySelection.export_high_res_area() always calls get_selected_areas(), which requires list_poly_selection_coors to be populated via the "add" button. However, when users click the "export" button directly (via _download_callback), self.selected_exp_data is populated but list_poly_selection_coors remains empty. This causes get_selected_areas() to raise Exception('Please select the data area in the picture first!') even though valid data has been selected and exported.

Changes

  • stereo/plots/interact_plot/poly_selection.py:
    • Added _resolve_selected_areas() method that tries list_poly_selection_coors first (via get_selected_areas), then falls back to self.selected_exp_data, with a clear error message if neither is available
    • Updated export_high_res_area() to use _resolve_selected_areas() instead of directly calling get_selected_area_coors() / get_selected_areas()
    • Updated get_selected_area_coors() to use _resolve_selected_areas() for consistent behavior

Verification

  • AST syntax check passed
  • Import check passed (fails on missing h5py dependency in CI env, not related to this change)

Classification

  • Type: bug
  • Confidence: high
  • Severity: medium

Closes #330

Open in Web View Automation 

…xp_data when list_poly_selection_coors is empty

The export_high_res_area method in PolySelection required users to click
the 'add' button before exporting, but users who clicked 'export' directly
would have self.selected_exp_data populated without list_poly_selection_coors
being filled. This caused get_selected_areas() to raise an exception.

Added _resolve_selected_areas() that tries list_poly_selection_coors first,
then falls back to self.selected_exp_data, with a clear error message if
neither is available.

Co-authored-by: wanruiwen-genomics-cn <wanruiwen-genomics-cn@users.noreply.github.com>
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.

interact_spatial_scatter notworking

1 participant