Skip to content

export and import focus points #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025

Conversation

Alpaca233
Copy link
Contributor

Export focus points to CSV files and import

@Alpaca233 Alpaca233 marked this pull request as ready for review May 6, 2025 18:15
@hongquanli hongquanli requested a review from Copilot May 8, 2025 03:53
Copy link

@Copilot 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 introduces functionality to export and import focus points to CSV files, along with related UI changes.

  • Added export and import buttons to the point control section and connected their signals.
  • Implemented export_focus_points and import_focus_points methods with CSV-based data persistence.
  • Modified status label handling and adjusted some UI text and layout details.
Comments suppressed due to low confidence (1)

software/control/widgets.py:5705

  • Verify that the unit for the Z coordinate in the CSV header matches the unit used in the focus points data, as X and Y are in mm.
writer.writerow(["Region_ID", "X_mm", "Y_mm", "Z_um"])

y = float(row[y_idx])
z = float(row[z_idx])
imported_points.append((region_id, x, y, z))
except (ValueError, IndexError):
Copy link
Preview

Copilot AI May 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider logging a warning when a row conversion fails in the import process to help diagnose data issues instead of silently continuing.

Suggested change
except (ValueError, IndexError):
except (ValueError, IndexError) as e:
logging.warning(f"Failed to convert row {row}: {e}")

Copilot uses AI. Check for mistakes.

@hongquanli hongquanli merged commit 1b16585 into Cephla-Lab:master May 8, 2025
2 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