-
Notifications
You must be signed in to change notification settings - Fork 102
🆕 Define NucleusDetector
#967
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
base: dev-define-engines-abc
Are you sure you want to change the base?
🆕 Define NucleusDetector
#967
Conversation
|
This PR will take over #538 |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
behnazelhaminia
left a comment
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 to me, thanks.
measty
left a comment
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, just a few small comments to address
🚀 Summary
This PR introduces a new
NucleusDetectorengine to the TIAToolbox framework, enabling detection of nuclei from whole slide images (WSIs) or image patches using models such asMapDeandSCCNN. It supersedes PR #538 by leveragingdaskfor efficient, parallelized post-processing and result merging. The update also includes:✨ Key Features
New Engine:
NucleusDetector[[x], [y], [type], [probs]]).Technical Implementation
The detection pipeline operates as follows:
SemanticSegmentor.infer_wsi().dask.array.map_overlapto apply the model's post-processing function across the entire segmentation map. This allows the function to execute in parallel on chunks, after which the results are automatically merged back into a unified "detection_map", which is saved as zarr in a cache directory for further processing.1if the model does not produce probabilities).[[x], [y], [type], [probs]]) representing the detected nuclei. These records are then saved intoSQLiteStore(chunk-by-chunk),zarr, or adict(patch mode only).Output Formats
SQLiteStore
SQLiteStore.SQLiteStoreper patch.Dictionary
{ 'x': [...], 'y': [...], 'classes': [...], 'probs': [...] }{ 0: { 'x': [...], 'y': [...], 'classes': [...], 'probs': [...] }, 1: { ... } }Zarr
{ 'x': [...], 'y': [...], 'classes': [...], 'probs': [...] }da.arrayobjects, where each array corresponds to a patch.{ 'x': [[...], ...], 'y': [[...], ...], 'classes': [[...], ...], 'probs': [[...], ...] }Codebase Integration
NucleusDetectorintiatoolbox.modelsand engine registry.MapDeimplementation to use the new engine.SCCNNwithNucleusDetector.Tasks
NucleusDetectorengine.MapDeimplementation complete;SCCNNimplementation in progress/debugging).