Skip to content

Add the option to provide a reference file for txrm processing - #271

Merged
stephen-riggs merged 2 commits into
mainfrom
xrm-ref
Jun 16, 2026
Merged

Add the option to provide a reference file for txrm processing#271
stephen-riggs merged 2 commits into
mainfrom
xrm-ref

Conversation

@stephen-riggs

@stephen-riggs stephen-riggs commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Allow an xrm file to be provided as an external reference for txrm processing.

Also converts from using Optional to |

Pairs with DiamondLightSource/python-murfey#826

@stephen-riggs
stephen-riggs requested a review from tieneupin June 16, 2026 10:00
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.11%. Comparing base (97d7d59) to head (8edba05).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #271   +/-   ##
=======================================
  Coverage   83.10%   83.11%           
=======================================
  Files          70       70           
  Lines        9064     9065    +1     
  Branches     1245     1245           
=======================================
+ Hits         7533     7534    +1     
  Misses       1048     1048           
  Partials      483      483           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

stephen-riggs added a commit to DiamondLightSource/python-murfey that referenced this pull request Jun 16, 2026
If a txrm does not have an internal reference, instead of dismissing it search for a reference file in xrm format. Takes the most recent xrm which is not a mosaic image.

Still skips processing for txrms with less than 20 frames as these will be reference stacks.

Also changes the tilt series tags to remove angle naming, and skips transfer of "New folder"

Pairs with DiamondLightSource/cryoem-services#271

@tieneupin tieneupin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Nice work!

tifftomo = Path(stack_file).with_suffix(".tiff")
convert_and_save(txrm_file, str(tifftomo), custom_reference=None)
convert_and_save(
txrm_file, str(tifftomo), custom_reference=xrm_reference or None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fine, but did you write it this way to also guard against empty strings? If not, passing xrm_reference directly should already be fine, since it's meant to be a string or None already.

@stephen-riggs
stephen-riggs merged commit 0ba2096 into main Jun 16, 2026
12 checks passed
@stephen-riggs
stephen-riggs deleted the xrm-ref branch June 16, 2026 14:53
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