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.

The 3 matches
  1. [1] § Method › LV and CP segmentation method › Network architecture ↔ nnunetv2/training/loss/compound_losses.py, lines 8–56 · score 0.63 · Cross Entropy loss, Dice loss, softmax, weighted, Class
  2. [2] § Method › Model training ↔ nnunetv2/training/nnUNetTrainer/pretraining/pretrainedTrainer.py, lines 526–624 · score 0.62 · AdamW, weight decay, clipping, PyTorch, optimizer, trained
  3. [3] § Method › Model training ↔ nnunetv2/training/nnUNetTrainer/primus/primus_trainers.py, lines 25–124 · score 0.59 · AdamW, weight decay, clipping, PyTorch, optimizer, trained

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: 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 202f6ba, 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
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
Funding: National Research Foundation of Korea (RS-2023-00248100)
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 26 September 2026
Evidence: files inventoried
Commit: 202f6baa0adc2ef5f7b615df19cc4da970412cc0, 25 September 2026
Languages: Python (216), Shell (7)
Size: 303 files, 223 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 (125 files), NumPy (73 files), PyTorch (56 files), SimpleITK (10 files), scikit-image (6 files), SciPy (5 files), NiBabel (4 files), pandas (4 files), tifffile (3 files), Matplotlib (2 files), scikit-learn (1 file), seaborn (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
225 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;
  • 223 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, SimpleITK, tifffile, 9 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, SimpleITK, tifffile, 9 other tools, structural MRI / diffusion, 2 references
[3] doi:10.21037/qims-2026-0792 [code]
An nnU-Net-based framework with adaptive feature representation for 3D brain tumor segmentation.
Journal: Quantitative imaging in medicine and surgery
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, structural MRI / diffusion, 1 reference
[4] doi:10.3389/fnins.2026.1870124 [code]
An end-to-end pipeline for automated fetal brain segmentation and biometry from 3D SSFP MRI.
Journal: Frontiers in neuroscience
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, structural MRI / diffusion, 1 reference
[5] doi:10.1007/s12021-026-09817-x [code]
Circle of Willis-Guided Localization for Simultaneous Detection and Classification of Large Vessel Occlusions in Brain CTA.
Journal: Neuroinformatics
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, 1 reference
[6] doi:10.1016/j.adro.2026.102092 [code]
Effect of Anatomic Contextual Information on the Performance of a Convolutional Neural Network Tasked With Brain Metastasis Detection.
Journal: Advances in radiation oncology
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, 1 reference
[7] doi:10.1002/alz.71649 [code]
Postmortem brain MRI reveals differential associations of subcortical and limbic volumes with cortical thinning and neurodegenerative pathologies.
Journal: Alzheimer's & dementia : the journal of the Alzheimer's Association
In common: nnU-Net, SimpleITK, scikit-image, 8 other tools, structural MRI / diffusion, 2 references
[8] doi:10.64898/2026.07.15.26357954 [code]
Portable Ultra-Low Field MRI Deep-Learning Algorithms for White Matter Lesion Segmentation Improve Accuracy and Reflect Clinical Disability in Multiple Sclerosis
Journal: medRxiv (preprint)
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, structural MRI / diffusion
[9] doi:10.1136/jnnp-2025-335884 [code]
Diffusivity anisotropy signature of slowly expanding lesions predicts progression independent of relapse activity in multiple sclerosis.
Journal: Journal of neurology, neurosurgery, and psychiatry
In common: nnU-Net, SimpleITK, tifffile, 9 other tools, structural MRI / diffusion
[10] doi:10.3389/frai.2026.1771088 [code]
Few-shot deployment of pretrained MRI transformers in brain imaging tasks.
Journal: Frontiers in artificial intelligence
In common: nnU-Net, SimpleITK, scikit-image, 8 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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.