OSCR

Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI.

Code ↔ Paper

6 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.

4 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 6 matches
  1. [1] § Experimental setup and metrics › Experimental setup ↔ src/MedNeXtTrainer.py, lines 12 to 89 · score 0.85 · AdamW, weight decay, MedNeXt, PyTorch, batch, patch · block oscr:b:6CRWFWDJRRSNA-M · Report a mismatch
  2. [2] § Datasets and preprocessing › Preprocessing ↔ preprocess/preprocess_CNP.ipynb, lines 29 to 38 · score 0.65 · SlicerDMRI, diffusion tensor, fit, preprocessing, DWI · Report a mismatch
  3. [3] § Experimental setup and metrics › Experimental setup ↔ preprocess/preprocess_CNP.ipynb, lines 215 to 295 · score 0.58 · Min eigenvalue, Mid eigenvalue, Max eigenvalue, Linearity, Planarity, Trace · Report a mismatch
  4. [4] § Experimental setup and metrics › Experimental setup ↔ src/monaiTrainer.py, lines 10 to 67 · score 0.56 · SwinUnetr, PyTorch, batch, patch, modules, architecture · block oscr:b:JME2PW1AJECEX-V · Report a mismatch
  5. [5] § Methodology › Post-processing ↔ utils/conform.py, lines 272 to 288 · score 0.53 · largest connected component, background, segmentation · block oscr:b:VNWEPQNYP4Y45-O · Report a mismatch
  6. [6] § Methodology › Post-processing ↔ utils/load_neuroimaging_data.py, lines 1328 to 1342 · score 0.53 · largest connected component, background, segmentation · block oscr:b:A518D1R8KTZS0-A · 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

Jupyter notebook · 490 lines · 16 KB · Apache-2.0 · 2 matches

  1. # %%
  2. import os
  3. import shutil
  4. from glob import glob
  5. from joblib import Parallel, delayed
  6. from tqdm.auto import tqdm
  7. import subprocess
  8. from copy import copy, deepcopy
  9. import numpy as np
  10. import nibabel as nib
  11. from dipy.io import read_bvals_bvecs
  12. from dipy.io.image import load_nifti, save_nifti
  13. from dipy.core.gradients import gradient_table
  14. from dipy.reconst.dti import TensorModel, _roll_evals
  15. import sys
  16. sys.path.append("../utils")
  17. from load_neuroimaging_data import load_and_conform_image, map_wmparc2gtseg
  18. import json
  19. join = os.path.join
  20. # %%
  21. with open("../splits/CNP_patients.txt", "r") as f:
  22. patient_ids = [line.strip() for line in f]
  23. patient_ids = sorted(patient_ids)
  24. # %% [markdown]
  25. # # 3D Slicer Paths and other paths
  26. # %%
  27. DWIToDTIEstimation = "/home/say26747/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch /home/say26747/Downloads/Slicer-5.2.2-linux-amd64/NA-MIC/Extensions-31382/SlicerDMRI/lib/Slicer-5.2/cli-modules/DWIToDTIEstimation"
  28. DiffusionTensorScalarMeasurements = "/home/say26747/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch /home/say26747/Downloads/Slicer-5.2.2-linux-amd64/NA-MIC/Extensions-31382/SlicerDMRI/lib/Slicer-5.2/cli-modules/DiffusionTensorScalarMeasurements"
  29. BRAINSFit = "/home/say26747/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch /home/say26747/Downloads/Slicer-5.2.2-linux-amd64/lib/Slicer-5.2/cli-modules/BRAINSFit"
  30. ResampleScalarVectorDWIVolume = "/home/say26747/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch /home/say26747/Downloads/Slicer-5.2.2-linux-amd64/lib/Slicer-5.2/cli-modules/ResampleScalarVectorDWIVolume"
  31. MNI_template_brain_only = "/hdd/HPC100_preprocess/tpl-MNI152NLin6Sym/tpl-MNI152NLin6Sym_res-01_T1w_Brain_only.nii.gz"
  32. CNN_masking_path = "/home/say26747/Desktop/git/CNN-Diffusion-MRIBrain-Segmentation" # look for its repository on the web
  33. # %% [markdown]
  34. # # Unring data
  35. # %%
  36. root_data_dir = "/hdd/CNP_dataset/data/"
  37. def worker_unring(patient_id):
  38. dwi_path = join(
  39. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi.nii.gz"
  40. ) # change accordingly
  41. dwi_unring_path = join(
  42. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring"
  43. ) # change accordingly
  44. if os.path.exists(dwi_unring_path + ".nii.gz"):
  45. print(f"{dwi_unring_path} already exists")
  46. return
  47. # Define the Conda environment name
  48. conda_env_name = "fsl_base" # Replace this with your environment name
  49. command = f"conda run -n {conda_env_name} unring {dwi_path} {dwi_unring_path}"
  50. subprocess.run(command, shell=True, executable="/bin/bash", check=True)
  51. # %%
  52. results = Parallel(n_jobs=4)(
  53. delayed(worker_unring)(patient_id) for patient_id in tqdm(patient_ids)
  54. )
  55. # %% [markdown]
  56. # # Eddy correction
  57. # %%
  58. def worker_eddy_correction(patient_id):
  59. dwi_unring_path = join(
  60. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring.nii.gz"
  61. )
  62. dwi_eddy_path = join(
  63. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring_eddy"
  64. )
  65. dwi_bvals_path = join(
  66. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring.bval"
  67. )
  68. dwi_bvecs_path = join(
  69. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring.bvec"
  70. )
  71. if os.path.exists(dwi_eddy_path + ".nii.gz"):
  72. print(f"{dwi_eddy_path} already exists")
  73. return
  74. # Define the Conda environment name
  75. conda_env_name = "fsl_base" # Replace this with your environment name
  76. command = f"conda run -n {conda_env_name} pnl_eddy --bvals {dwi_bvals_path} --bvecs {dwi_bvecs_path} -i {dwi_unring_path} -o {dwi_eddy_path}"
  77. # print(command)
  78. subprocess.run(command, shell=True, executable="/bin/bash")
  79. # %%
  80. results = Parallel(n_jobs=4)(
  81. delayed(worker_eddy_correction)(patient_id) for patient_id in tqdm(patient_ids)
  82. )
  83. # %% [markdown]
  84. # # Masking using masking_CNN
  85. # %%
  86. dwi_eddy_paths = []
  87. for patient_id in patient_ids:
  88. dwi_eddy_path = dwi_eddy_path = join(
  89. root_data_dir, patient_id, "dwi", f"{patient_id}_dwi_unring_eddy.nii.gz"
  90. )
  91. if os.path.exists(dwi_eddy_path):
  92. dwi_eddy_paths.append(dwi_eddy_path)
  93. else:
  94. print(f"{dwi_eddy_path} does not exist")
  95. print(len(dwi_eddy_paths))
  96. # save the patient ids to a file (each path in one line)
  97. with open("/hdd/CNP_dataset/dwi_eddy_paths.txt", "w") as f:
  98. for path in dwi_eddy_paths:
  99. f.write(path + "\n")
  100. # %%
  101. for path in tqdm(dwi_eddy_paths):
  102. parent_dir = os.path.dirname(path)
  103. txt_file = join(parent_dir, "dwi_eddy_path.txt")
  104. masking_path = join(CNN_masking_path, "pipeline", "dwi_masking.py")
  105. model_path = join(CNN_masking_path, "model_folder")
  106. command = f"/home/say26747/anaconda3/bin/conda run -n dmri_seg {masking_path} -i {txt_file} -f {model_path} -filter scipy -p 97 -nproc 4"
  107. subprocess.run(command, shell=True, check=True, executable="/bin/bash")
  108. break
  109. # %% [markdown]
  110. # # diffusion-derived features
  111. # %%
  112. def worker_dwi_calculation(patient_id):
  113. dest_path = f"/hdd/CNP_dataset/data/{patient_id}/DATA"
  114. temp_dir = "/hdd/tmp/diffusion"
  115. os.makedirs(dest_path, exist_ok=True)
  116. os.makedirs(join(temp_dir, patient_id), exist_ok=True)
  117. dwi_root_path = f"/hdd/CNP_dataset/data/{patient_id}/dwi"
  118. if os.path.exists(join(dest_path, "trace_from_eigs.nii.gz")):
  119. print(f"Already processed {patient_id}")
  120. return
  121. # load the bvals and bvecs
  122. bvals, bvecs = read_bvals_bvecs(
  123. join(dwi_root_path, f"{patient_id}_dwi_unring_eddy.bval"),
  124. join(dwi_root_path, f"{patient_id}_dwi_unring_eddy.bvec"),
  125. )
  126. # load the DWI data
  127. dwi_data, dwi_affine = load_nifti(
  128. join(dwi_root_path, f"{patient_id}_dwi_unring_eddy.nii.gz")
  129. )
  130. b_value_threshold = 50
  131. b0_indecies = np.where(bvals < b_value_threshold)[0]
  132. b1000_indecies = np.where(np.abs(bvals - 1000) < b_value_threshold)[0]
  133. combined_indecies = np.concatenate([b0_indecies, b1000_indecies])
  134. dwi_filtered_data = dwi_data[..., combined_indecies]
  135. bvals_filtered = bvals[combined_indecies]
  136. bvecs_filtered = bvecs[combined_indecies]
  137. # save the filtered data
  138. save_nifti(join(temp_dir, patient_id, "DWI.nii.gz"), dwi_filtered_data, dwi_affine)
  139. # save the filtered bvals and bvecs
  140. np.savetxt(join(temp_dir, patient_id, "bvals"), bvals_filtered)
  141. np.savetxt(join(temp_dir, patient_id, "bvecs"), bvecs_filtered)
  142. # now write tell where to save the nhdr file
  143. dwi_nhdr = join(temp_dir, patient_id, "DWI_nhdr.nhdr")
  144. mask_nhdr = join(temp_dir, patient_id, "mask_nhdr.nhdr")
  145. subprocess.run(
  146. [
  147. "nhdr_write.py",
  148. "--nifti",
  149. join(temp_dir, patient_id, "DWI.nii.gz"),
  150. "--bval",
  151. join(temp_dir, patient_id, "bvals"),
  152. "--bvec",
  153. join(temp_dir, patient_id, "bvecs"),
  154. "--nhdr",
  155. dwi_nhdr,
  156. ]
  157. )
  158. shutil.copy(
  159. join(dwi_root_path, f"{patient_id}_dwi_unring_eddy_bse-multi_BrainMask.nii.gz"),
  160. join(temp_dir, patient_id, "mask.nii.gz"),
  161. )
  162. subprocess.run(
  163. [
  164. "nhdr_write.py",
  165. "--nifti",
  166. join(temp_dir, patient_id, "mask.nii.gz"),
  167. "--nhdr",
  168. mask_nhdr,
  169. ]
  170. )
  171. dti_nhdr = join(temp_dir, patient_id, "DTI.nhdr")
  172. b0_nhdr = join(temp_dir, patient_id, "b0.nhdr")
  173. subprocess.run(
  174. DWIToDTIEstimation.split()
  175. + [
  176. "--enumeration",
  177. "LS",
  178. dwi_nhdr,
  179. dti_nhdr,
  180. b0_nhdr,
  181. "-m",
  182. mask_nhdr,
  183. ]
  184. )
  185. fa_nhdr = join(temp_dir, patient_id, "FA.nhdr")
  186. trace_nhdr = join(temp_dir, patient_id, "trace.nhdr")
  187. minEig_nhdr = join(temp_dir, patient_id, "minEig.nhdr")
  188. midEig_nhdr = join(temp_dir, patient_id, "midEig.nhdr")
  189. maxEig_nhdr = join(temp_dir, patient_id, "maxEig.nhdr")
  190. planarity_nhdr = join(temp_dir, patient_id, "planarity.nhdr")
  191. linearity_nhdr = join(temp_dir, patient_id, "linearity.nhdr")
  192. sphericity_nhdr = join(temp_dir, patient_id, "sphericity.nhdr")
  193. fa_nifti = join(dest_path, "FA.nii.gz")
  194. trace_nifti = join(dest_path, "trace.nii.gz")
  195. minEig_nifti = join(dest_path, "minEig.nii.gz")
  196. midEig_nifti = join(dest_path, "midEig.nii.gz")
  197. maxEig_nifti = join(dest_path, "maxEig.nii.gz")
  198. planarity_nifti = join(dest_path, "planarity.nii.gz")
  199. linearity_nifti = join(dest_path, "linearity.nii.gz")
  200. sphericity_nifti = join(dest_path, "sphericity.nii.gz")
  201. subprocess.run(
  202. DiffusionTensorScalarMeasurements.split()
  203. + [
  204. "--enumeration",
  205. "FractionalAnisotropy",
  206. dti_nhdr,
  207. fa_nhdr,
  208. ]
  209. )
  210. subprocess.run(
  211. DiffusionTensorScalarMeasurements.split()
  212. + [
  213. "--enumeration",
  214. "Trace",
  215. dti_nhdr,
  216. trace_nhdr,
  217. ]
  218. )
  219. subprocess.run(
  220. DiffusionTensorScalarMeasurements.split()
  221. + [
  222. "--enumeration",
  223. "MinEigenvalue",
  224. dti_nhdr,
  225. minEig_nhdr,
  226. ]
  227. )
  228. subprocess.run(
  229. DiffusionTensorScalarMeasurements.split()
  230. + [
  231. "--enumeration",
  232. "MidEigenvalue",
  233. dti_nhdr,
  234. midEig_nhdr,
  235. ]
  236. )
  237. subprocess.run(
  238. DiffusionTensorScalarMeasurements.split()
  239. + [
  240. "--enumeration",
  241. "MaxEigenvalue",
  242. dti_nhdr,
  243. maxEig_nhdr,
  244. ]
  245. )
  246. subprocess.run(
  247. DiffusionTensorScalarMeasurements.split()
  248. + [
  249. "--enumeration",
  250. "PlanarMeasure",
  251. dti_nhdr,
  252. planarity_nhdr,
  253. ]
  254. )
  255. subprocess.run(
  256. DiffusionTensorScalarMeasurements.split()
  257. + [
  258. "--enumeration",
  259. "LinearMeasure",
  260. dti_nhdr,
  261. linearity_nhdr,
  262. ]
  263. )
  264. subprocess.run(
  265. DiffusionTensorScalarMeasurements.split()
  266. + [
  267. "--enumeration",
  268. "SphericalMeasure",
  269. dti_nhdr,
  270. sphericity_nhdr,
  271. ]
  272. )
  273. subprocess.run(
  274. [
  275. "nifti_write.py",
  276. "-i",
  277. fa_nhdr,
  278. ]
  279. )
  280. subprocess.run(
  281. [
  282. "nifti_write.py",
  283. "-i",
  284. trace_nhdr,
  285. ]
  286. )
  287. subprocess.run(
  288. [
  289. "nifti_write.py",
  290. "-i",
  291. minEig_nhdr,
  292. ]
  293. )
  294. subprocess.run(
  295. [
  296. "nifti_write.py",
  297. "-i",
  298. midEig_nhdr,
  299. ]
  300. )
  301. subprocess.run(
  302. [
  303. "nifti_write.py",
  304. "-i",
  305. maxEig_nhdr,
  306. ]
  307. )
  308. subprocess.run(
  309. [
  310. "nifti_write.py",
  311. "-i",
  312. planarity_nhdr,
  313. ]
  314. )
  315. subprocess.run(
  316. [
  317. "nifti_write.py",
  318. "-i",
  319. linearity_nhdr,
  320. ]
  321. )
  322. subprocess.run(
  323. [
  324. "nifti_write.py",
  325. "-i",
  326. sphericity_nhdr,
  327. ]
  328. )
  329. subprocess.run(
  330. [
  331. "nifti_write.py",
  332. "-i",
  333. b0_nhdr,
  334. ]
  335. )
  336. # now move the needed files
  337. shutil.move(fa_nhdr.replace(".nhdr", ".nii.gz"), fa_nifti)
  338. shutil.move(trace_nhdr.replace(".nhdr", ".nii.gz"), trace_nifti)
  339. shutil.move(minEig_nhdr.replace(".nhdr", ".nii.gz"), minEig_nifti)
  340. shutil.move(midEig_nhdr.replace(".nhdr", ".nii.gz"), midEig_nifti)
  341. shutil.move(maxEig_nhdr.replace(".nhdr", ".nii.gz"), maxEig_nifti)
  342. shutil.move(planarity_nhdr.replace(".nhdr", ".nii.gz"), planarity_nifti)
  343. shutil.move(linearity_nhdr.replace(".nhdr", ".nii.gz"), linearity_nifti)
  344. shutil.move(sphericity_nhdr.replace(".nhdr", ".nii.gz"), sphericity_nifti)
  345. shutil.move(b0_nhdr.replace(".nhdr", ".nii.gz"), join(dest_path, "b0.nii.gz"))
  346. shutil.copy(
  347. join(dwi_root_path, f"{patient_id}_dwi_unring_eddy_bse-multi_BrainMask.nii.gz"),
  348. join(dest_path, "brain_mask.nii.gz"),
  349. )
  350. shutil.rmtree(join(temp_dir, patient_id))
  351. img_data, img_affine = load_nifti(
  352. join(os.path.dirname(dwi_root_path), "freesurfer", "mri", "wmparc.mgz")
  353. )
  354. save_nifti(join(dest_path, "wmparc.nii.gz"), img_data, img_affine)
  355. img_data, img_affine = load_nifti(
  356. join(os.path.dirname(dwi_root_path), "freesurfer", "mri", "T1.mgz")
  357. )
  358. save_nifti(join(dest_path, "T1.nii.gz"), img_data, img_affine)
  359. eigs_data = []
  360. eigs_affine = []
  361. for eig in ["minEig", "midEig", "maxEig"]:
  362. eig_path = join(dest_path, f"{eig}.nii.gz")
  363. eig_data, eig_affine = load_nifti(eig_path)
  364. eigs_data.append(eig_data)
  365. eigs_affine.append(eig_affine)
  366. save_nifti(
  367. join(dest_path, "trace_from_eigs.nii.gz"),
  368. np.sum(eigs_data, axis=0),
  369. eigs_affine[0],
  370. )
  371. save_nifti(
  372. join(dest_path, "MD_from_eigs.nii.gz"),
  373. np.mean(eigs_data, axis=0),
  374. eigs_affine[0],
  375. )
  376. # %%
  377. results = Parallel(n_jobs=5)(
  378. delayed(worker_dwi_calculation)(patient_id) for patient_id in tqdm(patient_ids)
  379. )
  380. # %% [markdown]
  381. # # wmparc to dwi
  382. # %%
  383. def worker_fs2dwi(patient_id):
  384. dwi_path = (
  385. f"/hdd/CNP_dataset/data/{patient_id}/dwi/{patient_id}_dwi_unring_eddy.nii.gz"
  386. )
  387. dwi_mask_path = f"/hdd/CNP_dataset/data/{patient_id}/dwi/{patient_id}_dwi_unring_eddy_bse-multi_BrainMask.nii.gz"
  388. bse_path = f"/hdd/CNP_dataset/data/{patient_id}/dwi/{patient_id}_dwi_unring_eddy_bse.nii.gz"
  389. bval_path = (
  390. f"/hdd/CNP_dataset/data/{patient_id}/dwi/{patient_id}_dwi_unring_eddy.bval"
  391. )
  392. freesurfer_path = f"/hdd/CNP_dataset/data/{patient_id}/freesurfer"
  393. dwi_root_path = f"/hdd/CNP_dataset/data/{patient_id}/dwi"
  394. fs2dwi_exc = "nifti_fs2dwi"
  395. command = f"{fs2dwi_exc} --dwi {dwi_path} --dwimask {dwi_mask_path} --bse {bse_path} --bvals {bval_path} -f {freesurfer_path} -o {dwi_root_path} direct"
  396. subprocess.run(command, shell=True, check=True)
  397. # %%
  398. results = Parallel(n_jobs=5)(
  399. delayed(worker_fs2dwi)(patient_id) for patient_id in tqdm(patient_ids)
  400. )
  401. # %% [markdown]
  402. # # Making the data registered to MNI and conformed
  403. # %%
  404. with open("../utils/wmparc_values_to_sequence.json", "r") as file:
  405. lookup_table = json.load(file)
  406. # swap the keys and values
  407. lookup_table = {v: k for k, v in lookup_table.items()}
  408. def worker_ras_MNI_conform(patient_id):
  409. root_path = f"/hdd/CNP_dataset/data/{patient_id}"
  410. wmparc_dwi_path = join(root_path, "dwi", "wmparcInDwi.nii.gz")
  411. dwi_mask_path = join(root_path, "DATA", "brain_mask.nii.gz")
  412. b0 = join(root_path, "DATA", "b0.nii.gz")
  413. # modalities=["FA", "trace_from_eigs", "maxEig", "minEig", "midEig"]
  414. modalities = ["sphericity"]
  415. img_path = join(root_path, "DATA", "images")
  416. os.makedirs(img_path, exist_ok=True)
  417. labels_path = join(root_path, "DATA", "labels")
  418. os.makedirs(labels_path, exist_ok=True)
  419. for modality in modalities:
  420. modality_path = join(root_path, "DATA", f"{modality}.nii.gz")
  421. img = nib.load(modality_path)
  422. img = img.as_reoriented(nib.orientations.io_orientation(img.affine))
  423. nib.save(img, join(img_path, f"{modality}_ras.nii.gz"))
  424. ResampleScalarVectorDWIVolume_command = (
  425. ResampleScalarVectorDWIVolume.split()
  426. + [
  427. "--interpolation",
  428. "linear",
  429. "--Reference",
  430. MNI_template_brain_only,
  431. "--transformationFile",
  432. join(root_path, "DATA", "transformations", "b0_to_MNI_Brain.tfm"),
  433. join(img_path, f"{modality}_ras.nii.gz"),
  434. join(img_path, f"{modality}_ras_MNI.nii.gz"),
  435. ]
  436. )
  437. subprocess.run(ResampleScalarVectorDWIVolume_command)
  438. modality_path = join(img_path, f"{modality}_ras_MNI.nii.gz")
  439. header_info, affine_info, data = load_and_conform_image(
  440. modality_path, interpol=3, imagetype="image"
  441. )
  442. nib.save(
  443. nib.Nifti1Image(data, affine=affine_info, header=header_info),
  444. modality_path.replace(".nii.gz", "_conform.nii.gz"),
  445. )
  446. # %%
  447. results = Parallel(n_jobs=5)(
  448. delayed(worker_ras_MNI_conform)(patient_id) for patient_id in tqdm(patient_ids)
  449. )

preprocess_CNP.ipynb at commit 31ce4ab, under Apache-2.0 · at the source

Overview

Authors: Yousef Sadegheih1, Dorit Merhof1,2
  1. Faculty of Informatics and Data Science, University of Regensburg,Regensburg, 93053 Germany
  2. Fraunhofer Institute for Digital Medicine MEVIS,Bremen, 28359 Germany
Journal: Scientific reports, volume 16, issue 1, article 17182
Dates: received 15 October 2025; accepted 19 May 2026; published online 3 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-54446-8 · PMID 42236782 · PMCID PMC13234126 · OpenAlex W4417174513
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism), methods / tools (subfield)
Methods: Connectivity, Spectral & time-frequency, Statistics, fMRI & imaging
Keywords: Deep learning, Segmentation, Parcellation, Diffusion MRI, Computational biology and bioinformatics, Engineering, Mathematics and computing, Medical research, Neurology, Neuroscience
MeSH: Brain*, Deep Learning*, Diffusion Magnetic Resonance Imaging*, Image Processing, Computer-Assisted*, Neuroimaging*, Connectome, Humans (* major topic)
Topic: Advanced Neuroimaging Techniques and Applications (Radiology, Nuclear Medicine and Imaging, Medicine), according to OpenAlex
Funding: Universität Regensburg (3161)
Citations: cited by 1 paper (Europe PMC); 59 references in the paper

Abstract

Accurate brain parcellation in diffusion MRI (dMRI) space is essential for advanced neuroimaging analyses. However, most existing approaches rely on anatomical MRI for segmentation and inter-modality registration, a process that can introduce errors and limit the versatility of the technique. In this study, we present a novel deep learning-based framework for direct parcellation based on the Desikan-Killiany (DK) atlas using only diffusion MRI-derived data. Our method utilizes a hierarchical, two-stage segmentation network: the first stage performs coarse parcellation into broad brain regions, and the second stage refines the segmentation to delineate more detailed subregions within each coarse category. We conduct an extensive ablation study to evaluate various diffusion-derived parameter maps, identifying a top-performing combination of fractional anisotropy, trace, sphericity, and maximum eigenvalue that enhances parcellation accuracy compared with previously used parameter choices. When evaluated on the Human Connectome Project, our approach achieves higher Dice Similarity Coefficients compared to existing state-of-the-art methods. On the Consortium for Neuropsychiatric Phenomics dataset, where reliable voxel-wise DK reference labels in diffusion space are not available, our method demonstrates label-free evidence of robustness across different image resolutions and acquisition protocols by producing more homogeneous parcellations as measured by the relative standard deviation within regions. This work represents a step toward more practical dMRI-based brain parcellation by avoiding the need for anatomical MRI and subject-specific anatomical-to-diffusion registration at inference time. The implementation of our method is publicly available on https://github.com/xmindflow/DKParcellationdMRI.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

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

xmindflow/DKParcellationdMRI

License: Apache-2.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 31ce4abcdff551850687dea9e05b925cc02ee83a, 16 October 2025
Languages: Python (12), Jupyter (3), Shell (1)
Size: 34 files, 16 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file, 3 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (7 files), nnU-Net (6 files), NumPy (6 files), NiBabel (5 files), DIPY (2 files), MONAI (2 files), scikit-image (2 files), SciPy (2 files), FreeSurfer (1 file), h5py (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
18 files

Code availability

The implementation of our method is publicly available on github.com/xmindflow/DKParcellationdMRI.

Reproduced under the paper's license (CC BY), from the paper cited above.

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;
  • 16 scripts, each with its path and the digest of its content;
  • 6 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

Data availability

The diffusion MRI and structural MRI data used in this study are publicly available. Human Connectome Project (HCP) data can be accessed at https://www.humanconnectome.org, and Consortium for Neuropsychiatric Phenomics (CNP) data are available through the OpenNeuro repository under accession number ds000030 and can be accessed at https://openneuro.org/datasets/ds000030/versions/00016. The source code and trained model implementation for the proposed framework are publicly available at https://github.com/xmindflow/DKParcellationdMRI. All data supporting the findings of this study are described within the manuscript

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, 2 authors, 10 keywords, 7 MeSH terms, 1 funder, 43 references.

Cite

This paper

Sadegheih, Y., & Merhof, D. (2026). Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI. Scientific reports, 16(1), 17182. https://doi.org/10.1038/s41598-026-54446-8

BibTeX

@article{sadegheih2026deep,
author = {Sadegheih, Yousef and Merhof, Dorit},
title = {{Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI}},
journal = {Scientific reports},
year = {2026},
month = jun,
volume = {16},
number = {1},
pages = {17182},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-54446-8},
url = {https://doi.org/10.1038/s41598-026-54446-8},
pmid = {42236782},
pmcid = {PMC13234126}
}

RIS

TY - JOUR
AU - Sadegheih, Yousef
AU - Merhof, Dorit
TI - Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/06/03
VL - 16
IS - 1
SP - 17182
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-54446-8
UR - https://doi.org/10.1038/s41598-026-54446-8
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-54446-8",
"type": "article-journal",
"title": "Deep learning-based Desikan-Killiany parcellation of the brain using diffusion MRI",
"container-title": "Scientific reports",
"author": [
{
"family": "Sadegheih",
"given": "Yousef"
},
{
"family": "Merhof",
"given": "Dorit"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "17182",
"DOI": "10.1038/s41598-026-54446-8",
"PMID": "42236782",
"PMCID": "PMC13234126",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-54446-8",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
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/advs.76596 [code]
DDSurfer: A Weakly-Supervised Dual-Stream Deep Learning Framework for Cortical Surface Reconstruction From Diffusion MRI.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: FreeSurfer, NiBabel, PyTorch, 2 other tools, methods / tools, structural MRI / diffusion, 16 references
[2] doi:10.1162/imag.a.1183 [code]
Learning-based segmentation of diffusion-weighted MR images with arbitrary &lt;i&gt;q&lt;/i&gt;-space samplings.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: scikit-image, h5py, NiBabel, 3 other tools, methods / tools, structural MRI / diffusion, 12 references
[3] doi:10.1002/hbm.70041 [code]
Assessment of the Depiction of Superficial White Matter Using Ultra-High-Resolution Diffusion MRI.
Journal: Human brain mapping
In common: DIPY, FreeSurfer, NiBabel, 2 other tools, methods / tools, structural MRI / diffusion, 11 references
[4] doi:10.1038/s41597-024-03624-2 [code]
A diffusion MRI tractography atlas for concurrent white matter mapping across Eastern and Western populations.
Journal: Scientific data
In common: DIPY, FreeSurfer, scikit-image, 4 other tools, methods / tools, structural MRI / diffusion, 8 references
[5] doi:10.1002/hbm.26497 [code]
Reconstructing the somatotopic organization of the corticospinal tract remains a challenge for modern tractography methods.
Journal: Human brain mapping
In common: DIPY, NiBabel, PyTorch, 2 other tools, structural MRI / diffusion, 8 references
[6] doi:10.3389/fnins.2024.1385847 [code]
A practical guide for combining functional regions of interest and white matter bundles.
Journal: Frontiers in neuroscience
In common: DIPY, FreeSurfer, NiBabel, 3 other tools, methods / tools, structural MRI / diffusion, 6 references
[7] doi:10.1162/imag_a_00353
Diffusion MRI with Machine Learning.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: methods / tools, structural MRI / diffusion, 9 references
[8] doi:10.3389/fnins.2024.1376570 [code]
A systematic review of automated methods to perform white matter tract segmentation.
Journal: Frontiers in neuroscience
In common: DIPY, h5py, NiBabel, 3 other tools, methods / tools, structural MRI / diffusion, 5 references
[9] doi:10.1162/imag_a_00559 [code]
Body size and intracranial volume interact with the structure of the central nervous system: A multi-center in vivo neuroimaging study.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: nnU-Net, MONAI, DIPY, 5 other tools, structural MRI / diffusion, 2 references
[10] doi:10.1162/imag.a.45 [code]
Automatic segmentation of spinal cord lesions in MS: A robust tool for axial T2-weighted MRI scans.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: nnU-Net, MONAI, DIPY, 5 other tools, methods / 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.1038/s41598-026-54446-8.svg)](https://openscicode.org/badge/doi/10.1038/s41598-026-54446-8)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41598-026-54446-8.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41598-026-54446-8
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41598-026-54446-8"><img src="https://openscicode.org/badge/doi/10.1038/s41598-026-54446-8.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.