Skip to content

penalize for FP,FN for segmentations - #5

Closed
Astarakee wants to merge 1 commit into
mainfrom
mehdi-brats
Closed

Astarakee wants to merge 1 commit into
mainfrom
mehdi-brats

Conversation

@Astarakee

Copy link
Copy Markdown
Collaborator

The following were updated to meet the requirements for BraTS2026 segmentations:

  • parser script: now takes into account both FP and FN for penalizing the segmentation metrics;
  • jupyter notebook: now includes examples on how to parse for METs and other SEG tasks.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates BraTS METs example outputs and notebook guidance to reflect BraTS 2026 segmentation metric parsing behavior, including updated FP/FN penalization examples and an added SEG parsing example.

Changes:

  • Updates the METs summary CSV with revised small-lesion FN/F1 values.
  • Adds a SEG summary CSV generated from the sample metrics JSON.
  • Expands the METs notebook with BraTS 2026 thresholds and a SEG parsing section.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
example/sample_seg_summary.csv Adds sample output for the seg parser.
example/sample_mets_summary.csv Updates METs parser sample metrics for the revised FN handling.
example/brats_mets.ipynb Updates notebook commands, saved outputs, thresholds, and parsing documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread example/brats_mets.ipynb
"- **Lesion-wise Segmentation Metrics for Large Lesions**\n",
"- **Detection Metrics for Small Lesions**\n",
"\n",
"As shown above, the last three rows of the DataFrame conveniently provide the **mean** and **standard deviation (std)** and **median** for each metric column, calculated over all valid (non-NaN) rows. This gives a quick statistical overview of the algorithm's performance across the entire dataset.\""
Comment thread example/brats_mets.ipynb
"cell_type": "code",
"source": "!brats-evaluate \\\n --config mets \\\n --ref_path ./sample_data/ref/ \\\n --pred_path ./sample_data/pred/ \\\n --summary_json ./sample_mets_metrics.json",
"source": [
"!python ../brats_evaluation/evaluation.py \\\n",
Comment thread example/brats_mets.ipynb
"cell_type": "code",
"source": "!brats-parse-metrics mets \\\n --json_path ./sample_mets_metrics.json \\\n --output_csv_path ./sample_mets_summary.csv",
"source": [
"!python ../brats_evaluation/metrics_parser.py mets \\\n",
Comment thread example/brats_mets.ipynb
"cell_type": "code",
"source": [
"# For simplicity we use the metrics cmoputed from the METs samples:\n",
"!python ../brats_evaluation/metrics_parser.py seg \\\n",
Comment thread example/brats_mets.ipynb
},
"cell_type": "code",
"source": [
"# For simplicity we use the metrics cmoputed from the METs samples:\n",
Comment thread example/brats_mets.ipynb
Comment on lines +74 to +78
"/home/mehdi/anaconda3/envs/bratseval/lib/python3.10/site-packages/panoptica/metrics/normalized_surface_dice.py:41: UserWarning: The threshold is set to 0.5, which is the default value, which may not be appropriate for your data.\r\n",
" warnings.warn(\r\n",
"[2/4] Evaluating BraTS-MET-00217-000-seg.nii.gz...\r\n",
"[3/4] Evaluating BraTS-MET-00630-001-seg.nii.gz...\r\n",
"/home/mehdi/anaconda3/envs/bratseval/lib/python3.10/site-packages/panoptica/utils/input_check_and_conversion/sanity_checker.py:182: UserWarning: The input arrays are not of integer type. This may lead to unexpected behavior in the segmentation maps.\r\n",
@Astarakee Astarakee closed this Jun 1, 2026
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