Skip to content

Add BraTS Mets panoptica tutorial with Standard PQ and Part PQ#77

Open
aymuos15 wants to merge 1 commit intoBrainLesion:mainfrom
aymuos15:brats-mets-panoptica-tutorial
Open

Add BraTS Mets panoptica tutorial with Standard PQ and Part PQ#77
aymuos15 wants to merge 1 commit intoBrainLesion:mainfrom
aymuos15:brats-mets-panoptica-tutorial

Conversation

@aymuos15
Copy link
Copy Markdown

@aymuos15 aymuos15 commented May 4, 2026

Summary

  • Adds a new Panoptica tutorial for BraTS Metastasis 2025 segmentation evaluation
  • Demonstrates per-sub-region Standard PQ (Necrotic, Edema, Enhancing evaluated independently)
  • Demonstrates Part PQ with Enhancing Tumor (3) as the thing and Necrotic Core (1) as the part, with Edema (2) evaluated as a standard LabelGroup
  • Includes threshold sweep comparing Standard PQ vs Part PQ across IoU thresholds 0.05–0.95

Demonstrates per-sub-region Standard PQ and hierarchical Part PQ
evaluation using BraTS-Mets 2025 segmentation labels.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()"
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