Open choosehappy opened 6 months ago
Seems like a simple regionprop + minimum area thresholding can work. Just return the length of skimage.measure.regionprops
output list and that's it.
Question would be - should that be in the final processing stage, or that the # of tissue pieces should be traced at the end of each module (as post processing). IMO reporting in the final processing is sufficient.
agree, final post processing is likely going to be sufficient
as well, I'm not sure that we have to make a hard decision
if we define the module, users can stick the module where they want in the pipeline, and even use it multiple times if they give it an associated tag via a prefix like this one:
@nanli-emory , can you add this to your list?
HistoTools project item: https://github.com/users/jacksonjacobs1/projects/2/views/1?pane=issue&itemId=62031151&sortedBy%5Bdirection%5D=desc&sortedBy%5BcolumnId%5D=Status
We will basically just need a function called count_tissue_pieces()
which gets the count as @CielAl described and records the count in the results tsv.
The question is, do we need a new module for this function or can we stick it in e.g, MorphologyModule.py
and add it to the end of the v2.1 pipeline?
@jacksonjacobs1 @nanli-emory
I think a standalone module might be overkilling. A few facts here helping us wrapping it into existing modules:
(1) Multiple modules involve collecting regionprops and corresponding stats (e.g., max/min of areas) and this piece of code is duplicated a lot. The # of tissue area is in fact also implicated in this computation.
(2) regionprops
is pickleable.
Therefore it might helpful to wrap regionprop-related statistics into a helper function wherein all modules can use it directly: e.g., given a mask (or regionprops, if already computed) and returns the # of connected tissue area, the summary statistics of these areas, etc. The resulted regionprops can be saved into the BaseImage as it's pickleable.
The advantage is that it reduces the amount of duplicated codes involving regionprops, and it also provides flexibility to report # of connected tissue areas after any arbitrary module (e.g., how many tissue pieces left after module1 and how many after module2, etc.).
from mask to use count + report # of unique pieces of tissue
should help identify e.g. TMAs and number of spots on the TMA