Fix dim Xenium morphology tiles and improve OME-TIFF loading - #294
Fix dim Xenium morphology tiles and improve OME-TIFF loading#294jaspreetishar wants to merge 23 commits into
Conversation
…g and normalization; detect new *0000*.ome.tif naming
huanlity
left a comment
There was a problem hiding this comment.
Thanks for working on this and making the ome-tif reading part more efficiently, these are super helpful. Please see my individual comments above and let me know if you have questions.
…ng hi calculation; tested use_row_groups=True without None in tile_dict.get((tile_i, tile_j))
|
Thank you for the helpful review, @huanlity! I have addressed your questions and implemented your suggestions. Please let me know your thoughts. |
huanlity
left a comment
There was a problem hiding this comment.
I tested the preprocess notebook and everything worked as expected. Great work! I approved the PR but maybe we can wait for Nick to take a look when he is back before merging.
Yes, that sounds good to me - thank you for your review! |
There was a problem hiding this comment.
Pull request overview
This PR adjusts Xenium morphology tile generation to avoid dim rendering on newer datasets by adding per-channel intensity windowing and memory-friendlier OME-TIFF channel loading, while threading new display parameters through the preprocessing entrypoint.
Changes:
- Add per-channel windowing and 8-bit display scaling controls (
upper_percentile,white_level) for morphology tile generation. - Update Xenium morphology discovery/loading to find
*0000*.ome.tifand read channels individually viatifffile. - Minor refactors/formatting in row-group-related tests and tile row-group ordering helpers.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/celldega/pre/__init__.py |
Implements per-channel windowing/gamma/white-level scaling and switches Xenium OME-TIFF loading to per-channel reads. |
src/celldega/pre/run_pre_processing.py |
Exposes upper_percentile/white_level in main() and forwards them into image tiling. |
src/celldega/pre/trx_tile.py |
Small cleanup in tile dict access when ordering tiles for row groups. |
src/celldega/pre/boundary_tile.py |
Small cleanup in tile dict access when ordering tiles for row groups. |
tests/unit/test_pre/test_row_groups.py |
Formatting/IO changes in row-group unit tests. |
tests/unit/test_pre/test_chromium.py |
Adds a stub module injection to allow importing celldega.pre in Chromium unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
copilot suggested fix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…a into img_intensity_fix
Image intensity normalization for Xenium tilesReworks Xenium morphology image tiling to use per-channel intensity windowing Changes
Merge note (main → branch)Resolved conflicts from the DEGA-487 cluster-collection merge by combining both sides:
|
Fix dim Xenium morphology tiles and improve OME-TIFF handling
upper_percentileargument is now added todega.pre.main()Read Xenium OME-TIFF channels individually using tifffile to avoid loading the full image stack into memory.
Detect morphology images using the
*0000*.ome.tifpattern to support newer Xenium image naming.** successfully tested the code changes on both private and public Xenium data.