Add BraTS Mets panoptica tutorial with Standard PQ and Part PQ#77
Open
aymuos15 wants to merge 1 commit intoBrainLesion:mainfrom
Open
Add BraTS Mets panoptica tutorial with Standard PQ and Part PQ#77aymuos15 wants to merge 1 commit intoBrainLesion:mainfrom
aymuos15 wants to merge 1 commit intoBrainLesion:mainfrom
Conversation
Demonstrates per-sub-region Standard PQ and hierarchical Part PQ evaluation using BraTS-Mets 2025 segmentation labels.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Panoptica tutorial notebook for BraTS-Mets 2025 segmentation evaluation, demonstrating Standard PQ per sub-region, Part PQ (thing+part hierarchy), and an IoU-threshold sweep comparison.
Changes:
- Introduces a new end-to-end notebook that loads example NIfTI masks and runs Standard PQ across BraTS sub-regions.
- Adds a Part PQ example (ET as thing, NCR as part) alongside standard evaluation of edema.
- Includes a threshold sweep (0.05–0.95) comparing Standard PQ (ET) vs Part PQ and visualizes the trend.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "\n", | ||
| "In **Standard PQ**, each sub-region is evaluated independently as a separate class.\n", | ||
| "\n", | ||
| "In **Part PQ**, the enhancing tumor and edema form the *thing* (the tumor instance), while the necrotic core is a *part* nested inside it — reflecting the biological hierarchy." |
Comment on lines
+62
to
+69
| "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m26.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m26.1\u001b[0m\r\n", | ||
| "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\r\n" | ||
| ] | ||
| } | ||
| ], | ||
| "source": [ | ||
| "!pip install panoptica auxiliary nibabel matplotlib numpy rich > /dev/null" | ||
| ] |
| "import numpy as np\n", | ||
| "import nibabel as nib\n", | ||
| "import matplotlib.pyplot as plt\n", | ||
| "from rich import print as rprint\n", |
Comment on lines
+316
to
+318
| " \"Necrotic\": LabelGroup(1),\n", | ||
| " \"Edema\": LabelGroup(2),\n", | ||
| " \"Enhancing\": LabelGroup(3),\n", |
Comment on lines
+673
to
+681
| "from panoptica.instance_matcher import NaiveThresholdMatching as NTM\n", | ||
| "\n", | ||
| "thresholds = np.arange(0.05, 1.0, 0.05)\n", | ||
| "pq_enhancing = []\n", | ||
| "pq_part = []\n", | ||
| "\n", | ||
| "print(\"Sweeping thresholds...\")\n", | ||
| "for thresh in thresholds:\n", | ||
| " matcher = NTM(matching_metric=Metric.IOU, matching_threshold=float(thresh))\n", |
| "ax.legend(fontsize=11)\n", | ||
| "ax.grid(True, linestyle=\"--\", alpha=0.6)\n", | ||
| "fig.tight_layout()\n", | ||
| "plt.show()" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary