spacetx / starfish

starfish: unified pipelines for image-based transcriptomics
https://spacetx-starfish.readthedocs.io/en/latest/
MIT License
223 stars 67 forks source link

create ImageStack from IntensityTable and SegmentationMaskCollection #1414

Closed pdichiaro closed 5 years ago

pdichiaro commented 5 years ago

Is it possible to create ImageStack from IntensityTable and SegmentationMaskCollection?

I was wondering if it is possible to use starfish.ImageStack.from_numpy.

Screenshot 2019-06-19 at 18 43 08
ttung commented 5 years ago

It would not be possible to go back to ImageStack once you move to spot space (the exception is if you are using pixel decoding, which technically does retain all the data to go back to image space).

ttung commented 5 years ago

Could you describe the use case that might require this?

pdichiaro commented 5 years ago

I need to visually inspect Segmentation.Watershed to see which threshold to apply to nuclei and stain images. I was wondering if there is a function that returns the outline of segmented cells. Starfish.display does not work in this case.

After starfish.spots.TargetAssignment.Label I need to visualize the resulting IntensityTable to see if it works and all dots that are only contained within cells. I tried to use MERmaid but I do not know if I can use it with starfish outputs.

shanaxel42 commented 5 years ago

@dganguli

dganguli commented 5 years ago

Hi @pdichiaro, @ttung is correct in that there is no clean way to create an ImageStack from an IntensityTable and SegmentationMaskCollection. We do not support this functionality.

However, for your use case, there is currently a PR under review (https://github.com/spacetx/starfish/pull/1430) that lets you use Starfish.display to view segmentation masks on top of your imaging data. Starfish.display also currently allows you to view spots on top of your image data. As such, Starfish.display will now satisfy both of your use cases. Using Starfish.display, you will be able to visually inspect the quality of your cell segmentation and target assignment.

Furthermore, you can use MERmaid with Starfish. IntensityTable exposes a to_mermaid function that allows you to visualize your spots in Mermaid.

This PR is likely to be merged shortly.

dganguli commented 5 years ago

I'll close this for now, but please re-open if this does not solve your problem!