Skip to content

📝 Add a RankSEG post-processing example notebook - #1175

Merged
shaneahmed merged 2 commits into
TissueImageAnalytics:developfrom
rankseg:docs/rankseg-notebook
Nov 13, 2026
Merged

shaneahmed merged 2 commits into
TissueImageAnalytics:developfrom
rankseg:docs/rankseg-notebook

Conversation

@statmlben

Copy link
Copy Markdown
Contributor

Related to #1172.

Thank you for suggesting an example notebook as a starting point. This PR adds a self-contained tutorial demonstrating RankSEG foreground decoding with TIAToolbox's MicroNet pipeline.

Summary

  • Add examples/13-rankseg-postprocessing.ipynb and an entry in examples/README.md.
  • Compare argmax and RankSEG using the same probabilities from the pretrained micronet-consep model on Kumar test images.
  • Apply MicroNet's instance postprocessor to both decoded masks and evaluate full-image foreground Dice.
  • Include an embedded visual comparison, saved execution outputs, and a reproducible evaluation of all 14 test images.

RankSEG is installed as an optional package within the notebook. Model weights and data are downloaded when needed.

Example results

Dice is computed per image and then averaged with equal weight.

Evaluation Images Argmax Dice RankSEG Dice Gain Images improved
CoNSeP-trained MicroNet → Kumar test set 14 61.26% 64.94% +3.68 percentage points 14/14

The illustrated case is explicitly identified as a favorable example selected after reviewing the cohort. Results describe foreground overlap on this small cross-dataset cohort; instance-separation quality requires separate evaluation.

Validation

  • Executed the notebook, including the full 14-image evaluation, on an NVIDIA RTX 3090.
  • Used Python 3.12, TIAToolbox 2.1.3, and RankSEG 0.0.8 with safe screening enabled.
  • Verified that the argmax adapter reproduces the official engine's instance output.
  • Passed pre-commit checks for the changed files.
  • Colab execution has not been separately verified.

I would appreciate feedback on the notebook's structure and its use of the TIAToolbox 2.x inference API.

This commit introduces a new Jupyter notebook (13-rankseg-postprocessing.ipynb) that compares argmax and RankSEG decoding of MicroNet probability maps. It utilizes a CoNSeP-trained model on Kumar test images, retaining TIAToolbox inference and instance postprocessing, and evaluates foreground Dice. The notebook includes visual comparisons and optional evaluations for all 14 test images.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.91%. Comparing base (dd79833) to head (34a7dfc).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1175   +/-   ##
========================================
  Coverage    99.91%   99.91%           
========================================
  Files          116      116           
  Lines        13567    13567           
  Branches      1622     1622           
========================================
  Hits         13556    13556           
  Misses           5        5           
  Partials         6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shaneahmed shaneahmed changed the title Add a RankSEG post-processing example notebook 📝 Add a RankSEG post-processing example notebook Oct 30, 2026
@shaneahmed

Copy link
Copy Markdown
Member

@statmlben Please would you be able to pull changes from develop and merge in this branch so the tests are updated?

@statmlben

Copy link
Copy Markdown
Contributor Author

Thanks @shaneahmed! I’ve merged the latest develop into this branch. Pre-commit, DeepSource, and the documentation build have passed. Thank you!

@shaneahmed
shaneahmed merged commit c4a5afa into TissueImageAnalytics:develop Nov 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants