Skip to content

Conversation

@cqian89
Copy link

@cqian89 cqian89 commented Jan 21, 2026

Summary

  • Fixed get_fluorescence_decay to correctly handle stack_frames=True by accumulating data from all frames into the first output frame.
  • Improved precision in get_phasor by using float instead of int for result storage.
  • Updated reference binary data for CLSM tests to reflect these improvements.

…ecision loss in get_phasor

- get_fluorescence_decay: when stack_frames=true, now correctly processes
  all frames instead of only the first frame. Uses target_frame index to
  write all photons to frame 0 of output while iterating over all n_frames.

- get_phasor: fix precision loss in non-stacked branch where phasor values
  (floats between -1 and 1) were cast to int, truncating all precision.
  Changed static_cast<int> to static_cast<float>.

- Update test reference files to reflect correct stacked decay behavior.
@cqian89 cqian89 marked this pull request as ready for review January 21, 2026 13:11
Copilot AI review requested due to automatic review settings January 21, 2026 13:11
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 366b1e2aa6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cqian89 cqian89 changed the title fix: improve CLSM analysis methods fix: CLSM get_fluorescence_decay and get_phasor Jan 21, 2026
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 pull request fixes two bugs in CLSM (Confocal Laser Scanning Microscopy) analysis methods related to frame stacking and numerical precision.

Changes:

  • Fixed get_fluorescence_decay to correctly accumulate data from all frames when stack_frames=True, instead of only processing the first frame
  • Improved numerical precision in get_phasor by casting to float instead of int, preventing truncation of decimal values
  • Updated test reference data to reflect the corrected output

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

@tpeulen
Copy link
Member

tpeulen commented Jan 21, 2026

Thanks for the PR and the detailed description and validation against the BH vendor exports.

I am currently planning a new release and will integrate your changes as part of that effort. The upcoming release focuses mainly on improved memory management (no API changes) and is a slightly larger update; current ETA is end of February. I will keep the pull request open for now, integrate your changes internally, and then merge your PR as part of the next release.

Afterwards, I will take care of publishing the update to conda-forge and pip (on my personal TODO list). Thanks again for the careful implementation!

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