OSCR

BT-CAP: a subcomponent-aware and anatomically constrained data augmentation framework for multi-modal brain tumor MRI segmentation.

Code ↔ Paper

16 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 16 matches
  1. [1] § Materials and methods › Context adaptation › Deforming peritumoral edema with anatomical constraints ↔ src/BT_CAP/edema.py, lines 5–44 · score 0.98 · outer shell, warped edema, map_coordinates, inner edema, displacement field, Gaussian filter
  2. [2] § Materials and methods › Core manipulation › B-spline deformation and reinsertion of tumor subcomponents ↔ src/BT_CAP/deform.py, lines 40–81 · score 0.86 · spline transformations, deformed mask, nearest neighbour, Random displacements, linear, resampled
  3. [3] § Materials and methods › Refinement › Inpainting empty areas in the tumor core ↔ src/BT_CAP/rearrange.py, lines 200–341 · score 0.80 · empty voxels, Gaussian filter, transformed islands, tumor core, placement, filled
  4. [4] § Materials and methods › Core manipulation › Rearranging tumor subcomponents for optimal core coverage ↔ src/BT_CAP/rearrange.py, lines 21–49 · score 0.79 · sub islands, distance transform, Large islands, peaks, watershed, splitting
  5. [5] § Materials and methods › Core manipulation › B-spline deformation and reinsertion of tumor subcomponents ↔ src/BT_CAP/main.py, lines 98–164 · score 0.78 · deformed mask, Random displacements, bounding box, reinserted, physical, rescaled
  6. [6] § Materials and methods › Core manipulation › Rearranging tumor subcomponents for optimal core coverage ↔ src/BT_CAP/rearrange.py, lines 90–141 · score 0.77 · transformed island, bounding box, minimizing, ftol, xtol, mass
  7. [7] § Materials and methods › Refinement › Inpainting empty areas in the tumor core ↔ src/BT_CAP/inpaint.py, lines 7–53 · score 0.77 · empty areas, Gaussian filter, original tumor core, donor, padded, Inpainting
  8. [8] § Results › Anatomical plausibility ↔ src/BT_CAP/edema.py, lines 5–44 · score 0.66 · displacement field, inner edema, edema mask, tumor core, zero, deformed
  9. [9] § Materials and methods › Refinement › Smoothing interfaces and managing outlier intensities ↔ src/BT_CAP/rearrange.py, lines 143–174 · score 0.65 · KD tree, modified, median, outlier, nearest, neighborhood
  10. [10] § Materials and methods › Context adaptation › Deforming peritumoral edema with anatomical constraints ↔ src/BT_CAP/main.py, lines 98–164 · score 0.64 · random displacement, original tumor core, uniformly, deformed, spacing, threshold
  11. [11] § Materials and methods › Core manipulation › Rearranging tumor subcomponents for optimal core coverage ↔ src/BT_CAP/rearrange.py, lines 90–141 · score 0.62 · empty_core, init_shift, clip, bbox, Rearranging, tumor
  12. [12] § Materials and methods › Implementation details ↔ src/BT_CAP/main.py, lines 318–327 · score 0.59 · random seed, BT CAP, Reproducibility, workers, Parallel, augmentation
  13. [13] § Materials and methods › Core manipulation › Rearranging tumor subcomponents for optimal core coverage ↔ src/BT_CAP/rearrange.py, lines 200–341 · score 0.58 · Find single enclosed, empty voxels, filled, neighbours, Rearranging, subcomponents
  14. [14] § Materials and methods › Core manipulation › Extracting tumor subcomponents ↔ src/BT_CAP/extract.py, lines 13–37 · score 0.56 · binary mask, bounding box, cropping, components, voxels, smooth
  15. [15] § Materials and methods › Implementation details ↔ src/BT_CAP/main.py, lines 318–327 · score 0.55 · BT CAP augmentation, random seed, CPU
  16. [16] § Materials and methods › Core manipulation › Rearranging tumor subcomponents for optimal core coverage ↔ src/BT_CAP/rearrange.py, lines 143–174 · score 0.52 · KD tree, NN, outliers, voxels, Rearranging, tumor

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 · 341 lines · 16 KB · MIT · 7 matches

  1. from __future__ import annotations
  2. from .utils import get_bounding_box, smooth_interface_with_kernel
  3. from scipy.ndimage import label, center_of_mass, affine_transform, generate_binary_structure, gaussian_filter, binary_opening, convolve, distance_transform_edt
  4. from scipy.optimize import minimize
  5. from skimage.segmentation import watershed
  6. from skimage.feature import peak_local_max
  7. from sklearn.neighbors import NearestNeighbors
  8. import numpy as np
  9. def extract_sorted_islands(mask: np.ndarray) -> list[np.ndarray]:
  10. labeled, num_features = label(mask.astype(np.uint8))
  11. islands = []
  12. for i in range(1, num_features + 1):
  13. comp = (labeled == i)
  14. cnt = int(comp.sum())
  15. if cnt > 0:
  16. islands.append((cnt, comp))
  17. islands.sort(reverse=True, key=lambda x: x[0])
  18. return [comp for _, comp in islands]
  19. def split_large_island(island: np.ndarray, threshold: int) -> list[tuple[int, np.ndarray]]:
  20. voxel_count = int(island.sum())
  21. if voxel_count <= threshold:
  22. return [(voxel_count, island.astype(np.uint8, copy=False))]
  23. dist = distance_transform_edt(island)
  24. if dist.max() < 1:
  25. return [(voxel_count, island.astype(np.uint8, copy=False))]
  26. coords = peak_local_max(dist, labels=island, num_peaks=2, exclude_border=False)
  27. if coords is None or len(coords) < 2:
  28. return [(voxel_count, island.astype(np.uint8, copy=False))]
  29. markers = np.zeros_like(island, dtype=np.int32)
  30. for i, c in enumerate(coords[:2], start=1):
  31. markers[tuple(c)] = i
  32. labels_ws = watershed(-dist, markers, mask=island)
  33. sub_islands = []
  34. for lbl in (1, 2):
  35. sub = (labels_ws == lbl)
  36. if sub.sum() >= 100:
  37. struct = generate_binary_structure(3, 1)
  38. sub = binary_opening(sub, structure=struct)
  39. cnt = int(sub.sum())
  40. if cnt > 0:
  41. sub_islands.append((cnt, sub.astype(np.uint8, copy=False)))
  42. if len(sub_islands) < 2:
  43. return [(voxel_count, island.astype(np.uint8, copy=False))]
  44. final = []
  45. for cnt, sub in sub_islands:
  46. final.extend(split_large_island(sub, threshold))
  47. return final
  48. def transform_island(
  49. island: np.ndarray,
  50. angles_deg: np.ndarray,
  51. shifts_vox: np.ndarray,
  52. modalities: np.ndarray | None = None,
  53. ) -> tuple[np.ndarray, np.ndarray | None]:
  54. theta_x, theta_y, theta_z = np.deg2rad(angles_deg.astype(float))
  55. Rx = np.array([[1, 0, 0],
  56. [0, np.cos(theta_x), -np.sin(theta_x)],
  57. [0, np.sin(theta_x), np.cos(theta_x)]], dtype=np.float64)
  58. Ry = np.array([[ np.cos(theta_y), 0, np.sin(theta_y)],
  59. [0, 1, 0 ],
  60. [-np.sin(theta_y), 0, np.cos(theta_y)]], dtype=np.float64)
  61. Rz = np.array([[ np.cos(theta_z), -np.sin(theta_z), 0],
  62. [ np.sin(theta_z), np.cos(theta_z), 0],
  63. [0, 0, 1]], dtype=np.float64)
  64. R = Rz @ Ry @ Rx
  65. center = (np.array(island.shape, dtype=np.float64) / 2.0)
  66. shifts = shifts_vox.astype(np.float64)
  67. offset = center - R @ center - shifts
  68. transformed_island = affine_transform(
  69. island.astype(np.float32, copy=False),
  70. R, offset=offset, order=0, mode="constant", cval=0.0, prefilter=False
  71. )
  72. transformed_island = (transformed_island > 0.5).astype(np.uint8)
  73. transformed_modalities = None
  74. if modalities is not None:
  75. C = modalities.shape[0]
  76. out = []
  77. for i in range(C):
  78. ch = affine_transform(
  79. modalities[i].astype(np.float32, copy=False),
  80. R, offset=offset, order=3, mode="constant", cval=0.0, prefilter=True
  81. )
  82. out.append(ch)
  83. transformed_modalities = np.stack(out, axis=0).astype(np.float32, copy=False)
  84. transformed_modalities *= transformed_island[None, ...]
  85. return transformed_island, transformed_modalities
  86. def optimize_island(
  87. island: np.ndarray,
  88. tumor_core: np.ndarray,
  89. covered_core: np.ndarray,
  90. angle_bounds: tuple[float, float] = (-180.0, 180.0),
  91. shift_margin_vox: float | None = None,
  92. maxiter: int = 80,
  93. rng: np.random.Generator = None
  94. ) -> np.ndarray:
  95. empty_core = (tumor_core.astype(bool) & (~covered_core.astype(bool)))
  96. bbox = get_bounding_box(tumor_core, [1])
  97. if bbox is None:
  98. return np.zeros(6, dtype=np.float32)
  99. (z_min, z_max), (y_min, y_max), (x_min, x_max) = bbox
  100. dz, dy, dx = (z_max - z_min), (y_max - y_min), (x_max - x_min)
  101. if shift_margin_vox is None:
  102. shift_margin_vox = 0.5
  103. shift_bounds = np.array([
  104. [-dx * shift_margin_vox, dx * shift_margin_vox],
  105. [-dy * shift_margin_vox, dy * shift_margin_vox],
  106. [-dz * shift_margin_vox, dz * shift_margin_vox],
  107. ], dtype=np.float64)
  108. ang_lo, ang_hi = angle_bounds
  109. angle_bounds_arr = np.array([[ang_lo, ang_hi]] * 3, dtype=np.float64)
  110. com_island = np.array(center_of_mass(island))
  111. if empty_core.any():
  112. com_core = np.array(center_of_mass(empty_core))
  113. else:
  114. com_core = np.array(center_of_mass(tumor_core))
  115. init_shift = (com_core - com_island)
  116. init_shift = np.clip(init_shift, shift_bounds[:, 0], shift_bounds[:, 1])
  117. init_angles = rng.uniform(ang_lo / 4.0, ang_hi / 4.0, size=3)
  118. x0 = np.concatenate([init_angles, init_shift]).astype(np.float64)
  119. def _clamp_params(p: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
  120. a = np.clip(p[:3], angle_bounds_arr[:, 0], angle_bounds_arr[:, 1])
  121. s = np.clip(p[3:], shift_bounds[:, 0], shift_bounds[:, 1])
  122. return a, s
  123. def cost(p: np.ndarray) -> float:
  124. a, s = _clamp_params(p)
  125. t_mask, _ = transform_island(island, a, s)
  126. sz = t_mask.sum()
  127. if sz == 0:
  128. return 1e6
  129. overlap = (t_mask.astype(bool) & empty_core).sum()
  130. score = overlap / float(sz)
  131. return -float(score)
  132. res = minimize(
  133. cost, x0, method="Powell",
  134. options={"maxiter": maxiter, "xtol": 0.2, "ftol": 0.1}
  135. )
  136. a, s = _clamp_params(res.x.astype(np.float64))
  137. return np.concatenate([a, s]).astype(np.float32)
  138. def clean_mask_intensity_knn(volume: np.ndarray, mask: np.ndarray, mad_thresh=3.5, iqr_factor=1.5, k=5):
  139. mask = mask.astype(bool)
  140. tumor_voxels = volume[mask]
  141. if tumor_voxels.size == 0:
  142. return volume.copy(), np.zeros_like(volume, dtype=bool)
  143. tumor_coords = np.argwhere(mask)
  144. median_intensity = np.median(tumor_voxels)
  145. mad = np.median(np.abs(tumor_voxels - median_intensity))
  146. if mad > 0:
  147. modified_z = 0.6745 * (tumor_voxels - median_intensity) / mad
  148. out_idx = np.where(np.abs(modified_z) > mad_thresh)[0]
  149. else:
  150. q1, q3 = np.percentile(tumor_voxels, [25, 75])
  151. iqr = q3 - q1
  152. lo, hi = q1 - iqr_factor * iqr, q3 + iqr_factor * iqr
  153. out_idx = np.where((tumor_voxels < lo) | (tumor_voxels > hi))[0]
  154. outlier_mask = np.zeros_like(volume, dtype=bool)
  155. if out_idx.size == 0:
  156. return volume.copy(), outlier_mask
  157. outlier_coords = tumor_coords[out_idx]
  158. outlier_mask[tuple(outlier_coords.T)] = True
  159. valid_coords = tumor_coords[np.setdiff1d(np.arange(len(tumor_coords)), out_idx)]
  160. valid_values = volume[tuple(valid_coords.T)]
  161. filled = volume.copy()
  162. if valid_coords.shape[0] == 0:
  163. return filled, outlier_mask
  164. nn = NearestNeighbors(n_neighbors=min(k, len(valid_coords)), algorithm="kd_tree")
  165. nn.fit(valid_coords)
  166. _, neigh_idx = nn.kneighbors(outlier_coords)
  167. for i, idxs in enumerate(neigh_idx):
  168. filled[tuple(outlier_coords[i])] = float(np.mean(valid_values[idxs]))
  169. return filled.astype(np.float32, copy=False), outlier_mask
  170. def find_single_enclosed_empty_voxels(mask: np.ndarray) -> np.ndarray:
  171. mask = mask.astype(bool)
  172. empty = ~mask
  173. struct = generate_binary_structure(3, 1).astype(np.uint8)
  174. neigh = convolve(mask.astype(np.uint8), struct, mode="constant", cval=0)
  175. enclosed = empty & (neigh == 6)
  176. return enclosed
  177. def fill_enclosed_with_neighbor_mean(intensity_vol: np.ndarray, enclosed_mask: np.ndarray) -> np.ndarray:
  178. filled = intensity_vol.copy()
  179. Z, Y, X = intensity_vol.shape
  180. coords = np.argwhere(enclosed_mask)
  181. for z, y, x in coords:
  182. vals = []
  183. if z > 0: vals.append(intensity_vol[z-1, y, x ])
  184. if z < Z-1: vals.append(intensity_vol[z+1, y, x ])
  185. if y > 0: vals.append(intensity_vol[z, y-1, x ])
  186. if y < Y-1: vals.append(intensity_vol[z, y+1, x ])
  187. if x > 0: vals.append(intensity_vol[z, y, x-1])
  188. if x < X-1: vals.append(intensity_vol[z, y, x+1])
  189. if vals:
  190. filled[z, y, x] = float(np.mean(vals))
  191. return filled.astype(np.float32, copy=False)
  192. def rearrange_subcomponents_into_core(
  193. tumor_core_dict: dict[int, tuple[np.ndarray, np.ndarray]],
  194. tumor_core: np.ndarray,
  195. case_name: str,
  196. sample_idx: int,
  197. queue=None,
  198. rng: np.random.Generator = None,
  199. ) -> tuple[np.ndarray, np.ndarray]:
  200. tumor_core = tumor_core.astype(np.uint8, copy=False)
  201. core_vox = int(tumor_core.sum())
  202. if core_vox == 0:
  203. return np.zeros_like(tumor_core, dtype=np.uint8), np.zeros((4, *tumor_core.shape), dtype=np.float32)
  204. threshold = max(100, core_vox // 2)
  205. enh_islands, nonenh_islands, cyst_islands = [], [], []
  206. for label_key, (sub_mask, sub_mods) in tumor_core_dict.items():
  207. for i_idx, island in enumerate(extract_sorted_islands(sub_mask)):
  208. if island.sum() < 100:
  209. continue
  210. for j_idx, (cnt, split_island) in enumerate(split_large_island(island, threshold)):
  211. if cnt < 100:
  212. continue
  213. tup = (cnt,
  214. f"Comp{label_key}-Island{i_idx}-Split{j_idx}",
  215. split_island.astype(np.uint8, copy=False),
  216. label_key,
  217. sub_mods)
  218. if label_key == 1:
  219. enh_islands.append(tup)
  220. elif label_key == 2:
  221. nonenh_islands.append(tup)
  222. elif label_key == 3:
  223. cyst_islands.append(tup)
  224. enh_islands.sort(key=lambda x: x[0], reverse=True)
  225. nonenh_islands.sort(key=lambda x: x[0], reverse=True)
  226. cyst_islands.sort(key=lambda x: x[0], reverse=True)
  227. total_islands = len(enh_islands) + len(nonenh_islands) + len(cyst_islands)
  228. if queue is not None:
  229. queue.put(("progress", case_name, sample_idx, 0, total_islands))
  230. covered_core = np.zeros_like(tumor_core, dtype=np.uint8)
  231. placed = 0
  232. placed_ETs_vol = np.zeros((4, *tumor_core.shape), dtype=np.float32)
  233. placed_NETs_vol = np.zeros((4, *tumor_core.shape), dtype=np.float32)
  234. placed_CCs_vol = np.zeros((4, *tumor_core.shape), dtype=np.float32)
  235. placed_ETs_mask = np.zeros_like(tumor_core, dtype=np.uint8)
  236. placed_NETs_mask = np.zeros_like(tumor_core, dtype=np.uint8)
  237. placed_CCs_mask = np.zeros_like(tumor_core, dtype=np.uint8)
  238. components = [
  239. (1, enh_islands, "Enhancing"),
  240. (2, nonenh_islands, "Non-enhancing"),
  241. (3, cyst_islands, "Cystic"),
  242. ]
  243. while any(len(lst) > 0 for _, lst, _ in components):
  244. candidates = []
  245. for label_idx, lst, _ in components:
  246. if lst:
  247. cnt, island_id, island_mask, key_lbl, sub_mods = lst[0]
  248. candidates.append((cnt, island_mask, island_id, key_lbl, sub_mods, lst))
  249. candidates.sort(key=lambda t: t[0], reverse=True)
  250. for _, island_mask, island_id, key_lbl, sub_mods, source_list in candidates:
  251. params = optimize_island(island_mask, tumor_core, covered_core, rng=rng)
  252. t_mask, t_mods = transform_island(island_mask, params[:3], params[3:], modalities=sub_mods)
  253. placed += 1
  254. if queue is not None:
  255. queue.put(("island_placement", case_name, sample_idx, placed, total_islands))
  256. if t_mask.any():
  257. t_mask = gaussian_filter(t_mask.astype(np.float32), sigma=1.0) > 0.6
  258. t_mask = t_mask.astype(np.uint8, copy=False)
  259. if t_mods is not None:
  260. t_mods *= t_mask[None, ...]
  261. within_core = (t_mask > 0) & (tumor_core > 0)
  262. if within_core.any() and t_mods is not None:
  263. if key_lbl == 1:
  264. placed_ETs_vol[:, within_core] = t_mods[:, within_core]
  265. for m in range(4):
  266. placed_ETs_vol[m] = smooth_interface_with_kernel(
  267. placed_ETs_vol[m], t_mask.astype(bool), placed_ETs_mask.astype(bool),
  268. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3)
  269. )
  270. placed_ETs_mask[within_core] = 1
  271. elif key_lbl == 2:
  272. placed_NETs_vol[:, within_core] = t_mods[:, within_core]
  273. for m in range(4):
  274. placed_NETs_vol[m] = smooth_interface_with_kernel(
  275. placed_NETs_vol[m], t_mask.astype(bool), placed_NETs_mask.astype(bool),
  276. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3)
  277. )
  278. placed_NETs_mask[within_core] = 1
  279. elif key_lbl == 3:
  280. placed_CCs_vol[:, within_core] = t_mods[:, within_core]
  281. for m in range(4):
  282. placed_CCs_vol[m] = smooth_interface_with_kernel(
  283. placed_CCs_vol[m], t_mask.astype(bool), placed_CCs_mask.astype(bool),
  284. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3)
  285. )
  286. placed_CCs_mask[within_core] = 1
  287. covered_core[within_core] = 1
  288. source_list.pop(0)
  289. ET_holes = find_single_enclosed_empty_voxels(placed_ETs_mask)
  290. NET_holes = find_single_enclosed_empty_voxels(placed_NETs_mask)
  291. CC_holes = find_single_enclosed_empty_voxels(placed_CCs_mask)
  292. cleaned_ETs = np.zeros_like(placed_ETs_vol, dtype=np.float32)
  293. cleaned_NETs = np.zeros_like(placed_NETs_vol, dtype=np.float32)
  294. cleaned_CCs = np.zeros_like(placed_CCs_vol, dtype=np.float32)
  295. for m in range(4):
  296. if placed_ETs_mask.any():
  297. cleaned_ETs[m], _ = clean_mask_intensity_knn(placed_ETs_vol[m], placed_ETs_mask)
  298. cleaned_ETs[m] = fill_enclosed_with_neighbor_mean(cleaned_ETs[m], ET_holes)
  299. placed_ETs_mask[ET_holes] = 1
  300. if placed_NETs_mask.any():
  301. cleaned_NETs[m], _ = clean_mask_intensity_knn(placed_NETs_vol[m], placed_NETs_mask)
  302. cleaned_NETs[m] = fill_enclosed_with_neighbor_mean(cleaned_NETs[m], NET_holes)
  303. placed_NETs_mask[NET_holes] = 1
  304. if placed_CCs_mask.any():
  305. cleaned_CCs[m], _ = clean_mask_intensity_knn(placed_CCs_vol[m], placed_CCs_mask)
  306. cleaned_CCs[m] = fill_enclosed_with_neighbor_mean(cleaned_CCs[m], CC_holes)
  307. placed_CCs_mask[CC_holes] = 1
  308. final_vol = np.zeros_like(placed_ETs_vol, dtype=np.float32)
  309. final_mask = np.zeros_like(tumor_core, dtype=np.uint8)
  310. inter_mask = np.zeros_like(tumor_core, dtype=np.uint8)
  311. if placed_NETs_mask.any():
  312. final_vol[:, placed_NETs_mask > 0] = cleaned_NETs[:, placed_NETs_mask > 0]
  313. for m in range(4):
  314. final_vol[m] = smooth_interface_with_kernel(final_vol[m], placed_NETs_mask.astype(bool), inter_mask.astype(bool),
  315. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3))
  316. inter_mask[placed_NETs_mask > 0] = 1
  317. final_mask[placed_NETs_mask > 0] = 2
  318. if placed_CCs_mask.any():
  319. final_vol[:, placed_CCs_mask > 0] = cleaned_CCs[:, placed_CCs_mask > 0]
  320. for m in range(4):
  321. final_vol[m] = smooth_interface_with_kernel(final_vol[m], placed_CCs_mask.astype(bool), inter_mask.astype(bool),
  322. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3))
  323. inter_mask[placed_CCs_mask > 0] = 1
  324. final_mask[placed_CCs_mask > 0] = 3
  325. if placed_ETs_mask.any():
  326. final_vol[:, placed_ETs_mask > 0] = cleaned_ETs[:, placed_ETs_mask > 0]
  327. for m in range(4):
  328. final_vol[m] = smooth_interface_with_kernel(final_vol[m], placed_ETs_mask.astype(bool), inter_mask.astype(bool),
  329. dilate_iter=2, alpha=0.7, kernel_size=(3, 3, 3))
  330. inter_mask[placed_ETs_mask > 0] = 1
  331. final_mask[placed_ETs_mask > 0] = 1
  332. return final_mask, final_vol

rearrange.py at commit 6957bba, under MIT · at the source

Overview

Authors: Amin Tavallaii1,2,3, Shamim Shah Ghasi3
ORCID iDs: Amin Tavallaii
  1. Computational Neurosurgery Lab, Department of Neurosurgery, Macquarie University, Sydney, NSW, Australia
  2. Iranian Pediatric Neurosurgery Research Center, Tehran University of Medical Sciences, Tehran, Iran
  3. Department of Neurosurgery, Mashhad University of Medical Sciences, Mashhad, Iran
Journal: Frontiers in radiology, volume 6, article 1785108
Dates: received 11 January 2026; accepted 20 April 2026; published online 12 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/fradi.2026.1785108 · PMID 42206199 · PMCID PMC13201455 · OpenAlex W7160948597
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), other condition (population), methods / tools (subfield)
Methods: Connectivity, Machine learning, Preprocessing, fMRI & imaging
Keywords: brain tumor, data augmentation, deep learning, multimodal MRI, segmentation
Topic: Advanced Neural Network Applications (Computer Vision and Pattern Recognition, Computer Science), according to OpenAlex
Citations: not cited yet (Europe PMC); 17 references in the paper

Abstract

Background: Data scarcity and class imbalance remain critical challenges in medical image analysis, particularly for brain tumor MRI segmentation, where subcomponents such as enhancing tumor, non-enhancing tumor, cystic component, and peritumoral edema are underrepresented. Existing augmentation strategies, from classical geometric transforms to GAN-based and diffusion model-based synthesis, either lack subcomponent-level control or require extensive generative model training, limiting their practicality in low-data settings.

Materials and methods: We propose the Brain Tumor Compositional Augmentation Pipeline (BT-CAP), a subcomponent-aware and anatomically constrained augmentation framework for multi-modal MRI. BT-CAP decomposes tumor subcomponents and recomposes them through a sequence of targeted operations, including isotropic scaling, B-spline deformation, Powell-optimized spatial rearrangement, inpainting, interface smoothing, and constrained edema deformation, applied consistently across all MRI modalities and segmentation masks, producing label-ready augmented volumes without additional annotation. We evaluated augmentation diversity (SSIM, label distribution, intensity variation, centroid displacement) and anatomical plausibility on 50 BraTS-PEDs 2025 cases, yielding 250 augmented volumes, and assessed segmentation performance on the full 256-case dataset using 3-fold cross-validation.

Results: BT-CAP achieved a mean SSIM of 0.956 ± 0.014 with wide subcomponent volume change ranges and realistic intensity heterogeneity, confirming meaningful structural diversity. By architectural design, all augmented segmentation mask voxels were confined within brain boundaries, and zero overlap between deformed edema and the tumor core was observed across all 250 cases. Segmentation experiments showed mean Dice score improvements of 6%–7% for tumor subcomponents and 2%–3% for tumor core and whole tumor compared to training without compositional augmentation, with a computational cost of approximately 2 min per case on CPU.

Conclusion: BT-CAP establishes a new class of compositional augmentation methods that deliver anatomically structured, label-ready, and scalable data generation without generative model training. The framework is applicable to any multi-class segmentation task where data scarcity and structural fidelity are critical, and is openly available at https://github.com/dramintavallaii/BT-CAP.

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 16 matches between paragraphs and lines of code.

dramintavallaii/BT-CAP

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 6957bba9ea25c8f588bca32eb18a60122e64252f, 5 September 2025
Languages: Python (11), Jupyter (2)
Size: 17 files, 13 scripts
Software Heritage: not archived
Found in: “Data availability statement”
Holds: README, license file, environment (requirements.txt, setup.py), 2 notebooks
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (10 files), SciPy (8 files), SimpleITK (5 files), scikit-image (2 files), scikit-learn (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
15 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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 13 scripts, each with its path and the digest of its content;
  • 16 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

No dataset and no data link were found in the paper.

Data availability statement

All data, code, and implementations used in this study are openly available at the following GitHub repository: https://github.com/dramintavallaii/BT-CAP. Further inquiries can be directed to the corresponding author.

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

Recorded: type, language, journal, volume, pages, dates, 2 authors, 5 keywords, 8 references.

Cite

This paper

Tavallaii, A., & Shah Ghasi, S. (2026). BT-CAP: a subcomponent-aware and anatomically constrained data augmentation framework for multi-modal brain tumor MRI segmentation. Frontiers in radiology, 6, 1785108. https://doi.org/10.3389/fradi.2026.1785108

BibTeX

@article{tavallaii2026bt,
author = {Tavallaii, Amin and Shah Ghasi, Shamim},
title = {{BT-CAP: a subcomponent-aware and anatomically constrained data augmentation framework for multi-modal brain tumor MRI segmentation}},
journal = {Frontiers in radiology},
year = {2026},
month = may,
volume = {6},
pages = {1785108},
publisher = {Frontiers Media SA},
issn = {2673-8740},
doi = {10.3389/fradi.2026.1785108},
url = {https://doi.org/10.3389/fradi.2026.1785108},
pmid = {42206199},
pmcid = {PMC13201455}
}

RIS

TY - JOUR
AU - Tavallaii, Amin
AU - Shah Ghasi, Shamim
TI - BT-CAP: a subcomponent-aware and anatomically constrained data augmentation framework for multi-modal brain tumor MRI segmentation
T2 - Frontiers in radiology
J2 - Front Radiol
PY - 2026
DA - 2026/05/12
VL - 6
SP - 1785108
SN - 2673-8740
PB - Frontiers Media SA
DO - 10.3389/fradi.2026.1785108
UR - https://doi.org/10.3389/fradi.2026.1785108
LA - en
ER -

CSL-JSON

{
"id": "10.3389/fradi.2026.1785108",
"type": "article-journal",
"title": "BT-CAP: a subcomponent-aware and anatomically constrained data augmentation framework for multi-modal brain tumor MRI segmentation",
"container-title": "Frontiers in radiology",
"author": [
{
"family": "Tavallaii",
"given": "Amin"
},
{
"family": "Shah Ghasi",
"given": "Shamim"
}
],
"container-title-short": "Front Radiol",
"volume": "6",
"page": "1785108",
"DOI": "10.3389/fradi.2026.1785108",
"PMID": "42206199",
"PMCID": "PMC13201455",
"ISSN": "2673-8740",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/fradi.2026.1785108",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
12
]
]
}
}

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.3389/fmed.2026.1875760 [code]
Adaptive multi-stage domain unlearning for white-matter lesion segmentation.
Journal: Frontiers in medicine
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, methods / tools, structural MRI / diffusion, 2 references
[2] doi:10.1002/hipo.70124 [code]
Association Between Anterior Hippocampal Gyrification and Episodic Memory Performance in Neurotypical Young Adults.
Journal: Hippocampus
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, structural MRI / diffusion, 2 references
[3] doi:10.1186/s12880-026-02335-x [code]
Automatic lateral ventricle and choroid plexus segmentation method in infant brain MR images.
Journal: BMC medical imaging
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, structural MRI / diffusion, 2 references
[4] 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: SimpleITK, scikit-image, scikit-learn, 2 other tools, methods / tools, structural MRI / diffusion, other condition, 1 reference
[5] doi:10.1038/s41598-026-48496-1 [code]
A unified FLAIR hyperintensity segmentation model for various CNS tumor types and acquisition time points.
Journal: Scientific reports
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, methods / tools, structural MRI / diffusion, other condition, 1 reference
[6] doi:10.1038/s41598-026-55397-w [code]
Fast surface reconstruction of human brain MRI: benchmarking deep-learning based morphometry tools.
Journal: Scientific reports
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, methods / tools, structural MRI / diffusion, 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: SimpleITK, scikit-image, scikit-learn, 2 other tools, structural MRI / diffusion, other condition, 1 reference
[8] 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: SimpleITK, scikit-image, scikit-learn, 2 other tools, structural MRI / diffusion, 1 reference
[9] doi:10.3390/biomedicines14071475 [code]
ETDACVO: Structural-Fidelity-Aware Evolutionary Co-Optimization for Robust and Explainable Brain Tumor MRI Classification.
Journal: Biomedicines
In common: SimpleITK, scikit-image, scikit-learn, 2 other tools, methods / tools, structural MRI / diffusion, other condition
[10] 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: SimpleITK, scikit-image, scikit-learn, 2 other tools, other condition, 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.