angelolab / ark-analysis

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

Single mantis directory #1059

Closed camisowers closed 11 months ago

camisowers commented 11 months ago

This is for internal use only; if you'd like to open an issue or request a new feature, please open a bug or enhancement issue

Instructions

This document should be filled out prior to embarking on any project that will take more than a couple hours to complete. The goal is to make sure that everyone is on the same page for the functionality and requirements of new features. Therefore, it's important that this is detailed enough to catch any misunderstandings beforehand. For larger projects, it can be useful to first give a high-level sketch, and then go back and fill in the details. For smaller ones, filling the entire thing out at once can be sufficient.

Relevant background

Addresses #669.

Design overview Current directory structure: (the masks are actually stored in fov subdirs in the mantis folder)

Screenshot 2023-09-07 at 1 35 31 PM

I think it would make more sense to have a higher level mantis directory that stores a copy of the segmentation masks, channel images, and then adds any masks that get generated.

Screenshot 2023-09-07 at 1 33 58 PM

We have two options with the generic cell notebook output:

  1. Keep it within the pixie/cell_output_dir_generic subdirectory, since this will be the only mantis directory.
  2. Also store the output in the top level mantis directory, since that’s the only mask that will be generated. (Unless the user runs both pixie and generic cell clustering which would be weird?)

Code mockup

The create_mantis_dir() function will need to be tweaked so that segmentation masks are not always copied over. The function already has a check to make sure channel images are no recopied, but this is not utilized since each notebook has it's own directory.

For the post_clusering output, we'll just need to change the name of the mask that's outputted from cell_mask.tiff to post_clustering_cell_mask.tiff.

Required inputs

Channel images, segmentation masks, and output masks from whichever notebook is being run.

Output files

A single mantis directory that contains descriptive names for any masks added by the notebooks.

Timeline Give a rough estimate for how long you think the project will take. In general, it's better to be too conservative rather than too optimistic.

Estimated date when a fully implemented version will be ready for review: Monday 9/11

Estimated date when the finalized project will be merged in: Wednesday 9/13

camisowers commented 11 months ago

@cliu72 Can you take a look at this and let me know if you want anything tweaked? Also would the names of any generated prefixed masks be prefix_fov1_pixel_mask.tiff or fov1_prefix_pixel_mask.tiff ?

cliu72 commented 11 months ago

This looks good to me! Sorry to throw off the timeline with my late response. I don't have strong opinions, but I think I slightly like the second option for the generic notebook better ("2. Also store the output in the top level mantis directory, since that’s the only mask that will be generated."), just so there's like consistently always a top-level mantis directory. Maybe if people want to compare pixie cell clustering with lorenz's method, it would be helpful to have them in the top-level directory.

Also don't have strong opinions about the location of the prefix - maybe prefix_fov1_pixel_mask.tiff? Not for any real reason, I just think it looks better lol