Add plugin to make thumbnails of xrm files#278
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
- Coverage 83.13% 83.13% -0.01%
==========================================
Files 75 75
Lines 9291 9356 +65
Branches 1264 1271 +7
==========================================
+ Hits 7724 7778 +54
- Misses 1075 1084 +9
- Partials 492 494 +2 🚀 New features to boost your workflow:
|
| import pandas as pd | ||
| import PIL.Image | ||
| import starfile | ||
| import tifffile |
There was a problem hiding this comment.
Double import? tifffile has been imported as tf right below this.
I'll leave it to you to pick which convention to use for this file. 👍
There was a problem hiding this comment.
That was an accident. I've got for tifffile as tf is sometimes tensorflow
There was a problem hiding this comment.
Ah, yes, that's fair, they both have the same initials.
| convert_and_save( | ||
| xrm_path, str(tiff_path).replace("_Annotated", ""), annotate=annotate or False | ||
| ) | ||
| data = tifffile.imread(tiff_path)[0] |
There was a problem hiding this comment.
Any plans to verify whether the read array is a stack, a 2D image, or something else?
There was a problem hiding this comment.
I've made this slightly safer, but it's not worth fully checking it. This at some point connects to questions around whether we continue to use txrm2tiff for conversion
tieneupin
left a comment
There was a problem hiding this comment.
tifffile has been imported twice. I leave it to you to decide on which convention to use for this file!
This adds functionality to read xrm images and request these are converted to tiffs. Currently this identifies atlas and roi images by finding out if they are montages, and splits them based on pixel size. Better methods may be possible but this should work for now. Rather than doing the xrm to tiff conversion here it puts a message onto rabbitmq. See DiamondLightSource/cryoem-services#278 Also contains a stub for registering rois in the database.
Add an images plugin which runs txrm2tiff conversion of xrms to annotated tiffs, then makes a jpg thumbnail for display
Links to DiamondLightSource/python-murfey#837