angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
71 stars 25 forks source link

Issue with segmentation mask stitching #1009

Closed camisowers closed 1 year ago

camisowers commented 1 year ago

Please refer to our FAQ and look at our known issues before opening a bug report.

Describe the bug Our segmentations masks apparently have a fun 3d shape, so (512, 512) images are actually stored as (1, 512, 512) arrays. This complicates things for stitching and throws an error in the Stitch Segmentation Output Images section of Image_Stitching.ipynb.

Expected behavior Should be able to stitch the segmentation masks by just squeezing it into a 2d array first.

To Reproduce Attempt to stitch segmentation masks.

ngreenwald commented 1 year ago

I think this has caused problems in a few other places. I think it would be easiest to modify the segmentation pipeline to save 2D tiffs rather than modifying the loading functions.

camisowers commented 1 year ago

Yeah I thought about just modifying create_deepcell_output(), but wasn't sure if changing it would cause any issues down the pipeline. Sounds good though!

ngreenwald commented 1 year ago

It might, but if it does, we should find those issues and fix them, since it's only the place in the whole repo where we have 3D tiffs for no reason.