Deep learning segmentation of paediatric brain tumours using diffusion-weighted MRI: towards an early, <i>in vivo</i> classification pipeline.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 119 lines · 5.1 KB · no license
- # -*- coding: utf-8 -*-
- """
- Created on Sat Dec 6 00:12:04 2025
- @author: mulvanyt
- """
- import nibabel as nib
- import numpy as np
- import glob
- from medpy.metric import dc, hd95, sensitivity, specificity, positive_predictive_value
- from fsl.utils.image import resample
- from fsl.data.image import Image
- import pandas as pd
- def getPredFromProb(pred, thresh=0.5, bm=None):
- """Applies a brainmask (optional) and threshold to probability map of ROI"""
- #Applies Brain Mask if specified
- if bm is not None:
- pred_masked = pred*bm
- #Applies Threshold
- pred_masked[pred_masked >= thresh] = 1
- pred_masked[pred_masked < thresh] = 0
- #Returns (integer) class prediction
- return pred_masked.astype(int)
- def getMetricRow(result, reference, pix_vol=1):
- """Returns selected metrics results as a list"""
- #Stores volumetric info
- row = [pix_vol,
- np.count_nonzero(result),
- np.count_nonzero(reference)]
- #Standard Metrics
- row.append(dc(result, reference))
- #Checks a volume exists in result to avoid error of blank comparison in HD95
- if row[1] > 3:
- row.append(hd95(result, reference))
- else:
- row.append(None)
- row.append(positive_predictive_value(result, reference))
- row.append(sensitivity(result, reference))
- row.append(specificity(result, reference))
- return row
- def saveCSV(data, out_fname):
- #Handles saving of a 2D matrix of patient results, with hardcoded column titles
- colnames = ["ID", "Voxel Volume", "N_Pred", "N_Ref", "DSC", "HD95", "PPV", "Sens.", "Spec."]
- df = pd.DataFrame(data, columns=colnames)
- df.to_csv(out_fname)
- #Specifies threshold for postprocessing probability mask
- thresh = 0.5
- #Folder containing each model's result folders
- root = "" #Redacted
- for folder in ["UnionEnsemble", "ADC", "b0", "b1000"]:
- #Finds all probability maps of predicted ROIs
- pred_files = glob.glob(f"{root}\\{folder}\\*\\*\\Test\\*ProbMapClass1.nii.gz")
- #Obtain IDs from filenames, and then sort both arrays by the ID
- IDs = [int(pred_f.split("\\")[-1].split("_")[0].removeprefix("Subj-")) for pred_f in pred_files]
- IDs, pred_files = zip(*sorted(zip(IDs, pred_files)))
- IDs = np.array(IDs)
- pred_files = list(pred_files)
- #Results tables for each resampling mode
- rows_iso = np.zeros((len(IDs), 9))
- rows_iso[:,0] = IDs
- rows_raw = np.copy(rows_iso)
- rows_zds = np.copy(rows_raw)
- #Loop through each patient, performing resampling, postprocessing, and metric calculation
- for p_i, pred_f in enumerate(pred_files):
- #Loads predicted ROI probability map
- prob_iso_obj = nib.load(pred_f)
- #Specifies location of GT ROIs and brainmask
- img_folder = f"{root}\\Pre-processed_v2\\Subj-{IDs[p_i]}\\"
- #Loads Isotropic files
- gt_iso_obj = nib.load(f"{img_folder}ROI_preprocessed.nii.gz")
- bm_iso_img = nib.load(f"{img_folder}B0_brainmask.nii.gz").get_fdata()
- prob_iso_img = prob_iso_obj.get_fdata()
- gt_iso_img = gt_iso_obj.get_fdata()
- #Loads raw GT ROI, and resamples brainmask and prob map to raw image space
- gt_raw_obj = nib.load(f"{img_folder}ROI_convert.nii")
- gt_raw_img = gt_raw_obj.get_fdata()
- bm_raw_img = resample.resample(Image(f"{img_folder}B0_brainmask.nii.gz"), gt_raw_img.shape, order=0)[0]
- prob_raw_img = resample.resample(Image(pred_f), gt_raw_img.shape, order=1)[0]
- #Resamples isotropic images (GT ROI, Brainmask, pred prob map) in z-direction to that of raw image space
- zds_shape = np.hstack((gt_iso_img.shape[0:2], gt_raw_img.shape[2]))
- gt_zds_img = resample.resample(Image(f"{img_folder}ROI_preprocessed.nii.gz"), zds_shape, order=0)[0]
- bm_zds_img = resample.resample(Image(f"{img_folder}B0_brainmask.nii.gz"), zds_shape, order=0)[0]
- prob_zds_img = resample.resample(Image(pred_f), zds_shape, order=1)[0]
- #Applies brainmask & threshold to prob maps to acquire binary prediction masks
- pred_iso_img = getPredFromProb(prob_iso_img, thresh=thresh, bm = bm_iso_img)
- pred_raw_img = getPredFromProb(prob_raw_img, thresh=thresh, bm = bm_raw_img)
- pred_zds_img = getPredFromProb(prob_zds_img, thresh=thresh, bm = bm_zds_img)
- #Calculate metrics of ROI w.r.t. GT ROIs (respective), storing results in table
- rows_iso[p_i, 1:] = getMetricRow(pred_iso_img, gt_iso_img)
- rows_raw[p_i, 1:] = getMetricRow(pred_raw_img, gt_raw_img,
- pix_vol=np.prod(gt_raw_obj.header["pixdim"][1:4]))
- rows_zds[p_i, 1:] = getMetricRow(pred_zds_img, gt_zds_img,
- pix_vol=gt_raw_obj.header["pixdim"][3])
- #Stores metric tables in files by modality/resampling strategy
- saveCSV(rows_iso, f"{root}\\{folder}_Metrics_ISO.csv")
- saveCSV(rows_raw, f"{root}\\{folder}_Metrics_raw.csv")
- saveCSV(rows_zds, f"{root}\\{folder}_Metrics_zds.csv")
DeepMedicMetricsExt.py at commit 39361bd, no license · at the source
Overview
- Aston Institute of Health and Neurodevelopment, College of Health and Life Sciences, Aston University, Birmingham B4 7TE, UK
- Medical Physics and Clinical Engineering, Nottingham University Hospitals NHS Trust, Nottingham NG5 1PB, UK
- College of Engineering and Physical Sci., Aston University, Birmingham B4 7TE, UK
- Department of Oncology, Birmingham Children’s Hospital, Birmingham B4 6NH, UK
- Department of Cancer and Genomic Sciences, University of Birmingham, Birmingham B15 2TT, UK
- School of Engineering, University of Birmingham, Birmingham B15 2TT, UK
Abstract
Diffusion-weighted MRI (DWI) can offer vital quantitative biomarkers to understand paediatric brain tumours to benefit clinical management. However, extraction of these markers requires delineation of the tumour margins, which is time-consuming, requires expertise and can still be highly variable. Automated approaches using deep learning to generate these tumour regions exist, but to our knowledge, few exist using only DWI as an input modality, with none in paediatrics. This retrospective study develops an automated segmentation approach, leveraging transfer learning and multi-modal ensembling to tackle the issues specific to this DWI-only approach. Using the Imaging of Tumors study data, we analysed data from 107 paediatric brain tumour patients. Using a 3D convolutional neural network, namely DeepMedic, to perform automatic segmentations, we demonstrate the benefit of these approaches for this task. We assess the accuracy of these predicted segmentations in comparison to the ‘ground truth’ manual annotations, with a median Dice score of 0.63 achieved by the best-performing model. The current study highlights the potential of this approach to be implemented in future clinical decision support tools using DWI, but more work is needed to improve segmentation accuracy or establish current performance as ‘sufficient’ for the purposes that these segmentations are required.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
tmulvanyAC/DWI_DeepMedic
39361bd95361df5a30bbf7a252517576eea38600, 6 December 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
1 file
- DeepMedicMetricsExt.py, Python, 119 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
Due to the sensitive nature of the data used in this study, which involves child patient data, the data cannot be shared publicly. Access to the data is restricted in accordance with ethical guidelines and study protocol. Specific code developed in the current study (beyond tools described here and above) is available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 5 keywords, 28 funders, 50 references.
Cite
This paper
Griffiths-King, D. J., Mulvany, T., Rose, H. E. L., Peet, A. C., Apps, J. R., Arvanitis, T. N., & Novak, J. (2026). Deep learning segmentation of paediatric brain tumours using diffusion-weighted MRI: towards an early, &
BibTeX
@article{griffithsking20
author = {Griffiths-King, Daniel J and Mulvany, Timothy and Rose, Heather E L and Peet, Andrew C and Apps, John R and Arvanitis, Theodoros N and Novak, Jan},
title = {{Deep learning segmentation of paediatric brain tumours using diffusion-weighted MRI: towards an early, \&
journal = {Brain communications},
year = {2026},
month = aug,
volume = {8},
number = {4},
pages = {fcag317},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/
url = {https://
pmid = {42643703},
pmcid = {PMC13504704}
}
RIS
TY - JOUR
AU - Griffiths-King, Daniel J
AU - Mulvany, Timothy
AU - Rose, Heather E L
AU - Peet, Andrew C
AU - Apps, John R
AU - Arvanitis, Theodoros N
AU - Novak, Jan
TI - Deep learning segmentation of paediatric brain tumours using diffusion-weighted MRI: towards an early, &
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/
VL - 8
IS - 4
SP - fcag317
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Deep learning segmentation of paediatric brain tumours using diffusion-weighted MRI: towards an early, &
"container-title": "Brain communications",
"author": [
{
"family": "Griffiths-King",
"given": "Daniel J"
},
{
"family": "Mulvany",
"given": "Timothy"
},
{
"family": "Rose",
"given": "Heather E L"
},
{
"family": "Peet",
"given": "Andrew C"
},
{
"family": "Apps",
"given": "John R"
},
{
"family": "Arvanitis",
"given": "Theodoros N"
},
{
"family": "Novak",
"given": "Jan"
}
],
"container-title-short":
"volume": "8",
"issue": "4",
"page": "fcag317",
"DOI": "10.1093/
"PMID": "42643703",
"PMCID": "PMC13504704",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
17
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pone.0356382 [code]
- Evaluating the impact of segmentation strategies on radiomic feature stability for paediatric brain tumour diagnosis using diffusion weighted imaging.Journal: PloS oneIn common: NiBabel, pandas, NumPy, structural MRI / diffusion, other condition, 6 references, 3 authors
- [2] doi:10.1371/journal.pone.0323398 [code]
- Ratio maps of T1w/
T2w MRI signal intensity do not improve deep-learning segmentation of pediatric brain tumors. Journal: PloS oneIn common: NiBabel, pandas, NumPy, methods / tools, structural MRI / diffusion, other condition, 6 references, 3 authors - [3] doi:10.1038/s41598-023-42414-5
- Predicting 'Brainage' in late childhood to adolescence (6-17yrs) using structural MRI, morphometric similarity, and machine learning.Journal: Scientific reportsIn common: structural MRI / diffusion, 2 authors
- [4] doi:10.3390/cancers15164015 [code]
- Deciphering Machine Learning Decisions to Distinguish between Posterior Fossa Tumor Types Using MRI Features: What Do the Data Tell Us?Journal: CancersIn common: pandas, NumPy, structural MRI / diffusion, other condition, 4 references
- [5] doi:10.1093/noajnl/vdag024 [code]
- Enhancing efficiency in pediatric brain tumor segmentation using a pathologically diverse single-center clinical dataset.Journal: Neuro-oncology advancesIn common: NiBabel, NumPy, structural MRI / diffusion, other condition, 4 references
- [6] doi:10.1093/neuonc/noaf058 [code]
- Applications of artificial intelligence and advanced imaging in pediatric diffuse midline glioma.Journal: Neuro-oncologyIn common: NiBabel, pandas, NumPy, structural MRI / diffusion, other condition, 3 references
- [7] doi:10.1038/s43856-025-01204-y [code]
- Segmentation-free pretherapeutic assessment of BRAF-status in pediatric low-grade gliomas.Journal: Communications medicineIn common: NiBabel, pandas, NumPy, structural MRI / diffusion, other condition, 3 references
- [8] doi:10.1007/s12565-023-00715-9 [code]
- Automated three-dimensional major white matter bundle segmentation using diffusion magnetic resonance imaging.Journal: Anatomical science internationalIn common: FSL, NiBabel, pandas, 1 other tool, methods / tools, structural MRI / diffusion, 3 references
- [9] doi:10.1186/s12916-026-04770-7 [code]
- Impairment of brain short association fibers across clinical stages in amyotrophic lateral sclerosis: a new biomarker mirroring disease progression.Journal: BMC medicineIn common: FSL, NiBabel, pandas, 1 other tool, structural MRI / diffusion, other condition, 4 references
- [10] doi:10.1162/imag.a.122 [code]
- Neural micro and macrostructural correlates of visual outcomes in children with unilateral cerebral palsy: A fixel-based study.Journal: Imaging neuroscience (Cambridge, Mass.)In common: FSL, NiBabel, pandas, 1 other tool, structural MRI / diffusion, other condition, 4 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:638bb266bed2ea6a…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1093/braincomms/fcag317)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1093/braincomms/fcag317.svg
:target: https://openscicode.org/badge/doi/10.1093/braincomms/fcag317
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/braincomms/fcag317"><img src="https://openscicode.org/badge/doi/10.1093/braincomms/fcag317.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
