OSCR

Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

3 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 3 matches
  1. [1] § Method › LV and CP segmentation method › Network architecture ↔ nnunetv2/training/loss/compound_losses.py, lines 8 to 56 · score 0.63 · Cross Entropy loss, Dice loss, softmax, weighted, Class · block oscr:b:P924R2QYNR2VP-R · Report a mismatch
  2. [2] § Method › Model training ↔ nnunetv2/training/nnUNetTrainer/pretraining/pretrainedTrainer.py, lines 526 to 624 · score 0.62 · AdamW, weight decay, clipping, PyTorch, optimizer, trained · block oscr:b:7SP4Z5DNNK8KE-G · Report a mismatch
  3. [3] § Method › Model training ↔ nnunetv2/training/nnUNetTrainer/primus/primus_trainers.py, lines 25 to 124 · score 0.59 · AdamW, weight decay, clipping, PyTorch, optimizer, trained · block oscr:b:V98ACZKRVJ5HX-Y · Report a mismatch

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 · 156 lines · 6.1 KB · Apache-2.0 · 1 match

  1. import torch
  2. from nnunetv2.training.loss.dice import SoftDiceLoss, MemoryEfficientSoftDiceLoss
  3. from nnunetv2.training.loss.robust_ce_loss import RobustCrossEntropyLoss, TopKLoss
  4. from nnunetv2.utilities.helpers import softmax_helper_dim1
  5. from torch import nn
  6. class DC_and_CE_loss(nn.Module):
  7. def __init__(self, soft_dice_kwargs, ce_kwargs, weight_ce=1, weight_dice=1, ignore_label=None,
  8. dice_class=SoftDiceLoss):
  9. """
  10. Weights for CE and Dice do not need to sum to one. You can set whatever you want.
  11. :param soft_dice_kwargs:
  12. :param ce_kwargs:
  13. :param aggregate:
  14. :param square_dice:
  15. :param weight_ce:
  16. :param weight_dice:
  17. """
  18. super(DC_and_CE_loss, self).__init__()
  19. if ignore_label is not None:
  20. ce_kwargs['ignore_index'] = ignore_label
  21. self.weight_dice = weight_dice
  22. self.weight_ce = weight_ce
  23. self.ignore_label = ignore_label
  24. self.ce = RobustCrossEntropyLoss(**ce_kwargs)
  25. self.dc = dice_class(apply_nonlin=softmax_helper_dim1, **soft_dice_kwargs)
  26. def forward(self, net_output: torch.Tensor, target: torch.Tensor):
  27. """
  28. target must be b, c, x, y(, z) with c=1
  29. :param net_output:
  30. :param target:
  31. :return:
  32. """
  33. if self.ignore_label is not None:
  34. assert target.shape[1] == 1, 'ignore label is not implemented for one hot encoded target variables ' \
  35. '(DC_and_CE_loss)'
  36. mask = target != self.ignore_label
  37. # remove ignore label from target, replace with one of the known labels. It doesn't matter because we
  38. # ignore gradients in those areas anyway
  39. target_dice = torch.where(mask, target, 0)
  40. num_fg = mask.sum()
  41. else:
  42. target_dice = target
  43. mask = None
  44. dc_loss = self.dc(net_output, target_dice, loss_mask=mask) \
  45. if self.weight_dice != 0 else 0
  46. ce_loss = self.ce(net_output, target[:, 0]) \
  47. if self.weight_ce != 0 and (self.ignore_label is None or num_fg > 0) else 0
  48. result = self.weight_ce * ce_loss + self.weight_dice * dc_loss
  49. return result
  50. class DC_and_BCE_loss(nn.Module):
  51. def __init__(self, bce_kwargs, soft_dice_kwargs, weight_ce=1, weight_dice=1, use_ignore_label: bool = False,
  52. dice_class=MemoryEfficientSoftDiceLoss):
  53. """
  54. DO NOT APPLY NONLINEARITY IN YOUR NETWORK!
  55. target mut be one hot encoded
  56. IMPORTANT: We assume use_ignore_label is located in target[:, -1]!!!
  57. :param soft_dice_kwargs:
  58. :param bce_kwargs:
  59. :param aggregate:
  60. """
  61. super(DC_and_BCE_loss, self).__init__()
  62. if use_ignore_label:
  63. bce_kwargs['reduction'] = 'none'
  64. self.weight_dice = weight_dice
  65. self.weight_ce = weight_ce
  66. self.use_ignore_label = use_ignore_label
  67. self.ce = nn.BCEWithLogitsLoss(**bce_kwargs)
  68. self.dc = dice_class(apply_nonlin=torch.sigmoid, **soft_dice_kwargs)
  69. def forward(self, net_output: torch.Tensor, target: torch.Tensor):
  70. if self.use_ignore_label:
  71. # target is one hot encoded here. invert it so that it is True wherever we can compute the loss
  72. if target.dtype == torch.bool:
  73. mask = ~target[:, -1:]
  74. else:
  75. mask = (1 - target[:, -1:]).bool()
  76. # remove ignore channel now that we have the mask
  77. # why did we use clone in the past? Should have documented that...
  78. # target_regions = torch.clone(target[:, :-1])
  79. target_regions = target[:, :-1]
  80. else:
  81. target_regions = target
  82. mask = None
  83. dc_loss = self.dc(net_output, target_regions, loss_mask=mask)
  84. target_regions = target_regions.float()
  85. if mask is not None:
  86. ce_loss = (self.ce(net_output, target_regions) * mask).sum() / torch.clip(mask.sum(), min=1e-8)
  87. else:
  88. ce_loss = self.ce(net_output, target_regions)
  89. result = self.weight_ce * ce_loss + self.weight_dice * dc_loss
  90. return result
  91. class DC_and_topk_loss(nn.Module):
  92. def __init__(self, soft_dice_kwargs, ce_kwargs, weight_ce=1, weight_dice=1, ignore_label=None):
  93. """
  94. Weights for CE and Dice do not need to sum to one. You can set whatever you want.
  95. :param soft_dice_kwargs:
  96. :param ce_kwargs:
  97. :param aggregate:
  98. :param square_dice:
  99. :param weight_ce:
  100. :param weight_dice:
  101. """
  102. super().__init__()
  103. if ignore_label is not None:
  104. ce_kwargs['ignore_index'] = ignore_label
  105. self.weight_dice = weight_dice
  106. self.weight_ce = weight_ce
  107. self.ignore_label = ignore_label
  108. self.ce = TopKLoss(**ce_kwargs)
  109. self.dc = SoftDiceLoss(apply_nonlin=softmax_helper_dim1, **soft_dice_kwargs)
  110. def forward(self, net_output: torch.Tensor, target: torch.Tensor):
  111. """
  112. target must be b, c, x, y(, z) with c=1
  113. :param net_output:
  114. :param target:
  115. :return:
  116. """
  117. if self.ignore_label is not None:
  118. assert target.shape[1] == 1, 'ignore label is not implemented for one hot encoded target variables ' \
  119. '(DC_and_CE_loss)'
  120. mask = (target != self.ignore_label).bool()
  121. # remove ignore label from target, replace with one of the known labels. It doesn't matter because we
  122. # ignore gradients in those areas anyway
  123. target_dice = torch.clone(target)
  124. target_dice[target == self.ignore_label] = 0
  125. num_fg = mask.sum()
  126. else:
  127. target_dice = target
  128. mask = None
  129. dc_loss = self.dc(net_output, target_dice, loss_mask=mask) \
  130. if self.weight_dice != 0 else 0
  131. ce_loss = self.ce(net_output, target) \
  132. if self.weight_ce != 0 and (self.ignore_label is None or num_fg > 0) else 0
  133. result = self.weight_ce * ce_loss + self.weight_dice * dc_loss
  134. return result

compound_losses.py at commit 1489d74, under Apache-2.0 · at the source

Overview

Authors: Junghwa Kang1, Hyun Gi Kim2,3, Na-Young Shin4,5, Yoonho Nam1
ORCID iDs: Na-Young Shin
  1. Department of Biomedical Engineering, Hankuk University of Foreign Studies,Yongin-si, Gyeonggi-do 17035 Korea
  2. Department of Radiology and Research Institute of Radiology, Asan Medical Center, University of Ulsan College of Medicine,Seoul, 05505 Republic of Korea
  3. Department of Radiology, Eunpyeong St. Mary’s Hospital, College of Medicine, The Catholic University of Korea,Eunpyeong-gu, Seoul, Korea
  4. Department of Radiology and Research Institute of Radiological Science and Center for Clinical Imaging Data Science, Yonsei University College of Medicine,Seoul, Republic of Korea
  5. Institute for Innovation in Digital Healthcare, Yonsei University,Seoul, Republic of Korea
Institutions: Hankuk University of Foreign Studies (South Korea); University of Ulsan (South Korea); Catholic University of Korea (South Korea); Yonsei University (South Korea)
Journal: BMC medical imaging, volume 26, issue 1, article 251
Dates: received 20 January 2026; accepted 1 April 2026; published online 3 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1186/s12880-026-02335-x · PMID 41933296 · PMCID PMC13173942 · OpenAlex W7148753308
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism), developmental (subfield)
Methods: Connectivity, Statistics, Machine learning, fMRI & imaging, Smoothing, state filtering, decompositions
Keywords: Choroid plexus, Lateral ventricle, Segmentation, Infant Brain
MeSH: Choroid Plexus*, Lateral Ventricles*, Connectome, Female, Humans, Image Processing, Computer-Assisted, Infant, Infant, Newborn, Male (* major topic)
Topic: Neonatal and fetal brain pathology (Pediatrics, Perinatology and Child Health, Medicine), according to OpenAlex
Citations: not cited yet (Europe PMC); 36 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

jhkang0526/Infant_LVCPseg

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 15554d2d6df5fb6ae9071b9fbbe590ed942e4e1d, 3 April 2026
Size: 1 file, 0 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
1 file

MIC-DKFZ/nnUNet

License: Apache-2.0
State: the link answers, verified on 27 October 2026
Evidence: files inventoried
Commit: 1489d746e084459581ff20382c1241d8cc2eb258, 22 October 2026
Languages: Python (228), Shell (7)
Size: 315 files, 235 scripts
Software Heritage: archived
Found in: the text, “Comparison method”
Holds: README, license file, environment (pyproject.toml, setup.py), tests, continuous integration, documentation
Not found: CITATION.cff
Tools: nnU-Net (136 files), NumPy (82 files), PyTorch (62 files), SimpleITK (15 files), scikit-image (7 files), SciPy (7 files), NiBabel (5 files), pandas (4 files), tifffile (4 files), Matplotlib (2 files), Pillow (1 file), pydicom (1 file), scikit-learn (1 file), seaborn (1 file)
Availability: 2 checks, the latest on 27 October 2026: the link answers
  • 27 October 2026: the link answers
  • 26 September 2026: the link answers
237 files

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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 235 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • 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

Datasets cited

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1186/s12880-026-02335-x.

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, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 4 keywords, 9 MeSH terms, 1 funder, 34 references.

Cite

This paper

Kang, J., Kim, H. G., Shin, N.-Y., & Nam, Y. (2026). Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images. BMC medical imaging, 26(1), 251. https://doi.org/10.1186/s12880-026-02335-x

BibTeX

@article{kang2026automatic,
author = {Kang, Junghwa and Kim, Hyun Gi and Shin, Na-Young and Nam, Yoonho},
title = {{Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images}},
journal = {BMC medical imaging},
year = {2026},
month = apr,
volume = {26},
number = {1},
pages = {251},
publisher = {BMC},
issn = {1471-2342},
doi = {10.1186/s12880-026-02335-x},
url = {https://doi.org/10.1186/s12880-026-02335-x},
pmid = {41933296},
pmcid = {PMC13173942}
}

RIS

TY - JOUR
AU - Kang, Junghwa
AU - Kim, Hyun Gi
AU - Shin, Na-Young
AU - Nam, Yoonho
TI - Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images
T2 - BMC medical imaging
J2 - BMC Med Imaging
PY - 2026
DA - 2026/04/03
VL - 26
IS - 1
SP - 251
SN - 1471-2342
PB - BMC
DO - 10.1186/s12880-026-02335-x
UR - https://doi.org/10.1186/s12880-026-02335-x
LA - en
ER -

CSL-JSON

{
"id": "10.1186/s12880-026-02335-x",
"type": "article-journal",
"title": "Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images",
"container-title": "BMC medical imaging",
"author": [
{
"family": "Kang",
"given": "Junghwa"
},
{
"family": "Kim",
"given": "Hyun Gi"
},
{
"family": "Shin",
"given": "Na-Young"
},
{
"family": "Nam",
"given": "Yoonho"
}
],
"container-title-short": "BMC Med Imaging",
"volume": "26",
"issue": "1",
"page": "251",
"DOI": "10.1186/s12880-026-02335-x",
"PMID": "41933296",
"PMCID": "PMC13173942",
"ISSN": "1471-2342",
"publisher": "BMC",
"URL": "https://doi.org/10.1186/s12880-026-02335-x",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
3
]
]
}
}

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.1002/hipo.70124 [code]
Association Between Anterior Hippocampal Gyrification and Episodic Memory Performance in Neurotypical Young Adults.
Journal: Hippocampus
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 2 references
[2] doi:10.3389/fmed.2026.1875760 [code]
Adaptive multi-stage domain unlearning for white-matter lesion segmentation.
Journal: Frontiers in medicine
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 2 references
[3] doi:10.1016/j.media.2023.102789 [code]
SynthSeg: Segmentation of brain MRI scans of any contrast and resolution without retraining.
Journal: Medical image analysis
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 2 references
[4] 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 one
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[5] doi:10.1186/s12880-025-01687-0 [code]
The impact of cerebral vessels morphological alteration and white matter hyperintensities burden on the one-year risk of ischemic stroke recurrence.
Journal: BMC medical imaging
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[6] doi:10.1186/s41747-025-00554-5 [code]
Enhancing deep learning methods for brain metastasis detection through cross-technique annotations on SPACE MRI.
Journal: European radiology experimental
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[7] doi:10.1007/s00701-024-05973-8 [code]
NnU-Net versus mesh growing algorithm as a tool for the robust and timely segmentation of neurosurgical 3D images in contrast-enhanced T1 MRI scans.
Journal: Acta neurochirurgica
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[8] doi:10.3389/fnimg.2023.1252261 [code]
Pseudo-Label Assisted nnU-Net enables automatic segmentation of 7T MRI from a single acquisition.
Journal: Frontiers in neuroimaging
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[9] doi:10.3389/fonc.2023.1143688 [code]
Deep-learning and conventional radiomics to predict <i>IDH</i> genotyping status based on magnetic resonance imaging data in adult diffuse glioma.
Journal: Frontiers in oncology
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference
[10] doi:10.1093/braincomms/fcad118 [code]
Brain tumour segmentation with incomplete imaging data.
Journal: Brain communications
In common: nnU-Net, pydicom, SimpleITK, 11 other tools, structural MRI / diffusion, 1 reference

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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x.svg)](https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x.svg
   :target: https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x"><img src="https://openscicode.org/badge/doi/10.1186/s12880-026-02335-x.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.