-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to set an explicit skip flag for custom regionprops and marker extraction functionality in notebook 1 #897
Conversation
… cell_table_slow
…nnel expression calculations
Tested with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping the extraction step makes sense for testing purposes to see where the bottleneck is, but for in terms of actual user setting, isn't relevant. The only reason to generate the cell table is to have the extracted intensity values.
The parameter that would be helpful for the user is the option to skip the custom regionprops functions, which are quite slow.
My understanding is that all the features in REGIONPROPS_BASE
don't contribute materially to the runtime. Is that correct? If so, then having a skip
flag which sets REGIONPROPS_SINGLE_COMP
and REGIONPROPS_MULTI_COMP
to None would be sufficient. If it's the case that certain features in REGIONPROPS_BASE
are also slow to compute, then the skip
flag should also remove any of those slow ones.
@ngreenwald fixed up the pipeline to only remove By removing certain regionprops base calculations (all but |
Got it. And what if you remove centroid and coord as coord as well? |
No significant difference, a couple tenths of a second difference at most. |
great, sounds good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation needs to be updated to reflect the behavior of skip extraction. Will you also add a flag in notebook1 with a description where the user can toggle this on or off?
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What is the purpose of this PR?
Closes #875. Since PyTorch/Tensorflow optimizations to running these extractions will require more changes to the Docker than anticipated, for now we add the functionality to skip these computations.
How did you implement your changes
A flag,
skip_extraction
, can be set forgenerate_cell_table
, which gets propagated to the internal extractions, allowing them to avoid running these expensive processes if so desired by the user.Remaining issues
We do need to maintain the
'cell_size'
,'label'
,'coords'
, and'centroid'
features fromregionprops
. The first 3 are needed for indexing and'centroid-0'
and'centroid-1'
(generated from'centroid'
) is needed for spatial LDA. This means there will still be the bottleneck of runningregionprops_table
, since I believe the way it works is it generates all the regionprops features and then subsets on them.Please comment if there are additional base features we should keep regardless of if
skip_extraction
is set.