OSCR

Analysis of acute stroke-like lesions in MELAS: Distribution, potential boundaries and spreading pattern.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 335 lines · 9.8 KB · BSD-3-Clause

  1. import numpy as np
  2. from numpy.linalg import eig
  3. from numpy.linalg import norm
  4. from scipy.optimize import minimize_scalar
  5. import matplotlib.pyplot as plt
  6. import seaborn as sns
  7. def whiten(X, use_np=True):
  8. """Utility function to whiten data without zero-mean centering. Whitening means removing correlation between
  9. features and making the individual features have unit variance.
  10. :param
  11. X : np.array
  12. Data matrix. This is assumed to be in the (uncommon) format n_features x n_samples
  13. use_np : bool, optional (default: `True`)
  14. Whether to use numpy to compute the covariance matrix
  15. :returns
  16. Z : np.array
  17. Data matrix, whitened to remove covariance between the features
  18. """
  19. if use_np:
  20. C_X = np.cov(X, rowvar=True)
  21. else:
  22. C_X = (X - X.mean(1)) @ (X - X.mean(1)).T
  23. D, E = eig(C_X)
  24. V = E @ np.diag(1 / np.sqrt(D)) @ E.T
  25. Z = V @ X
  26. return Z
  27. def rotation(phi):
  28. """Create 2D rotation matrix
  29. :param
  30. phi : float
  31. The angle by which we want to rotate.
  32. :returns
  33. A : np.array
  34. A 2D rotation matrix
  35. """
  36. return np.array([[np.cos(phi), np.sin(phi)],
  37. [-np.sin(phi), np.cos(phi)]])
  38. def loss(Y):
  39. """Compute the loss for a given reconstruction Y.
  40. This will simply be the sum of squared elements in the restriction
  41. of Y to it's negative elements
  42. :param
  43. Y : np.array
  44. Data matrix, reconstrcution of the sources
  45. :returns
  46. l : np.float
  47. The loss
  48. """
  49. # restrict Y to it's negative elements
  50. n_samples = Y.shape[1]
  51. Y_neg = np.where(Y < 0, Y, 0)
  52. return 1 / (2 * n_samples) * norm(Y_neg, ord='fro') ** 2
  53. def obj_fun(phi, Z):
  54. """Objective to be used for finding the optimum rotation angle
  55. :param
  56. phi : float
  57. Rotation angle for which we wish to compute the los
  58. Z : np.matrix
  59. Whitened data matrix. Must have two rows, each corresponding to one feature.
  60. :returns
  61. l : float
  62. loss corresponding to a rotation of Z in 2D around phi
  63. """
  64. # check input
  65. if Z.shape[0] != 2:
  66. raise ValueError('Z has more than two features.')
  67. # rotate the data
  68. W = rotation(phi)
  69. Y = W @ Z
  70. return loss(Y)
  71. def givens(n, i, j, phi):
  72. """Compute n-dimensional givens rotation
  73. :param
  74. n : int
  75. Dimension of the rotation matrix to be computed
  76. i, j : int
  77. Dimensions i and j define the surface we wish to rotate in
  78. phi : float
  79. Rotation angle
  80. :returns
  81. R : np.array
  82. Given's rotation
  83. """
  84. R = np.eye(n)
  85. R[i, i], R[j, j] = np.cos(phi), np.cos(phi)
  86. R[i, j], R[j, i] = np.sin(phi), -np.sin(phi)
  87. return R
  88. def torque(Y):
  89. """Compute torque values of Y.
  90. These correspond to the gradient if different directions, where
  91. each direction is a possible rotation in a surface defines by two axis. The resulting matrix of
  92. torque values will have zeroes on the diagonal and will by symmetric.
  93. :param
  94. Y : np.matrix
  95. Reconstruction of the sourdes
  96. :returns
  97. t_max : float
  98. Maximum torque value found
  99. ixs : tuple
  100. i-j coordinates corresponding to the max. This defines a hyperplane in n-dimensional space.
  101. G : np.array
  102. Matrix of torque values. Symmetric and zero on the diagonal. Only the upper half is computed.
  103. """
  104. # compute the rectified parts of Y
  105. Y_pos = np.where(Y > 0, Y, 0)
  106. Y_neg = np.where(Y < 0, Y, 0)
  107. # compute torque values
  108. n = Y.shape[0]
  109. G = np.zeros((n, n))
  110. for i in range(n):
  111. for j in range(i + 1, n):
  112. G[i, j] = np.dot(Y_pos[i, :], Y_neg[j, :]) - np.dot(Y_neg[i, :], Y_pos[j, :])
  113. # find max and corresponding indices
  114. t_max = np.amax(np.abs(G))
  115. result = np.where(np.abs(G) == t_max)
  116. ixs = [result[i][0] for i in range(len(result))]
  117. return t_max, ixs, G
  118. def run_nn_ica(X, t_tol=1e-1, t_neg=None, verbose=1, i_max=1e3, print_all=100,
  119. whiten_mat=True, keep='last', return_all=False):
  120. """Algorithm to run non-negative indipendent component analysis.
  121. Given some data X, find matrices A and S such that
  122. X = A S,
  123. where S is non-negative and has indipendent rows. We pose no
  124. constraint on the matrix A.
  125. This algorithm is implemented as described in Plumbley, 2003, and
  126. relies upon whitening and rotating the data. This is guaranteed to
  127. converge only if the sources are 'well grounded', i.e. have probability
  128. down to zero. Note that this is the implementation for a square mixing
  129. matrix A.
  130. Parameters
  131. --------
  132. X : np.array,
  133. The data matrix of shape (n_features, n_samples)
  134. t_tol : float, optional (default: `1e-1`)
  135. Stopping tolerance. If the maximum torque falls below this
  136. value, stop.
  137. t_neg: float, optional (default: `None`)
  138. Stopping number of negative elements. If #negative elements crosses
  139. this threshold, stop.
  140. verbose : int, optional (default: `1`)
  141. How much output to give
  142. i_max : int, optional (default: `1e3`)
  143. Maximum number of iterations
  144. print_all : int, optional (default: `100`)
  145. Print every print_all iterations
  146. whiten : bool, optional (default: `True`)
  147. whether to whiten the input matrix
  148. keep: Str, optional (default: `'last'`)
  149. which reconstruction to keep, possible options are:
  150. `'last'`, `'best_neg'`, `'best_tol'`
  151. and correspond to last, smallest #negative elements and smallest tolerance
  152. respectively
  153. return_all: bool, optional (default: `False`)
  154. whether to return all of the progress of Y, W
  155. returns Y_best, W_best, Z, t_max_arr, ys, ws
  156. Returns
  157. --------
  158. Y : np.array
  159. The reconstructed sources, up to scaling and permutation
  160. W : np.array
  161. The final rotation matrix
  162. Z : np.array
  163. The whitened data
  164. t_max_arr : np.array
  165. The maximum torque values for each iteration
  166. """
  167. assert keep in ('last', 'best_neg', 'best_tol'), f'Unknown selection criterion `{keep}`.'
  168. def set_best(Y, W, tol):
  169. nonlocal Y_best, W_best, tol_best
  170. if return_all:
  171. ys.append(Y)
  172. ws.append(W)
  173. if keep == 'last':
  174. is_better = True
  175. if keep == 'best_neg':
  176. is_better = Y_best is None or np.sum(Y_best < 0) > np.sum(Y < 0)
  177. else:
  178. is_better = tol_best > tol
  179. if is_better:
  180. Y_best, W_best = Y, W
  181. tol_best = tol # need to keep memory of this
  182. # lists that records the progress of Y and W
  183. ys = []
  184. ws = []
  185. # best values and tolerance so far
  186. Y_best, W_best = None, None
  187. tol_best = np.inf
  188. t_neg = -np.inf if t_neg is None else t_neg
  189. # initialise
  190. n = X.shape[0]
  191. W = np.eye(n)
  192. t_max_arr = []
  193. # whiten the data
  194. Z = whiten(X) if whiten_mat else X
  195. Y = W @ Z
  196. i = 0
  197. while True:
  198. # compute the max torque of Y and corresponding indices
  199. t_max, ixs, _ = torque(Y)
  200. t_max_arr.append(t_max)
  201. set_best(Y, W, t_max)
  202. if t_max < t_tol or np.sum(Y_best < 0) < t_neg: # converged
  203. print('=' * 10)
  204. print('i = {}, t_max = {:.2f}, ixs = {}, #negative = {}'.format(i, t_max, ixs, np.sum(Y_best < 0)))
  205. print('Converged. Returning the reconstruction.')
  206. if return_all:
  207. return Y_best, W_best, Z, t_max_arr, ys, ws
  208. return Y_best, W_best, Z, t_max_arr
  209. if i > i_max and t_max > t_max_arr[-2]: # failed to converge
  210. print('=' * 10)
  211. print('i = {}, t_max = {:.2f}, ixs = {}, #negative = {}'.format(i, t_max, ixs, np.sum(Y_best < 0)))
  212. print(f'Error: Failed to converge. Returning current matrices.')
  213. if return_all:
  214. return Y_best, W_best, Z, t_max_arr, ys, ws
  215. return Y_best, W_best, Z, t_max_arr
  216. # print some information
  217. if (verbose > 0) and (i % print_all == 0):
  218. print('i = {}, t_max = {:.2f}, ixs = {}, #negative = {}'.format(i, t_max, ixs, np.sum(Y < 0)))
  219. # reduce to axis pair, find rotation angle and construct givens matrix
  220. Y_red = Y[ixs, :]
  221. opt_res = minimize_scalar(fun=obj_fun, bounds=(0, 2 * np.pi), method='bounded', args=Y_red)
  222. R = givens(n, ixs[0], ixs[1], opt_res['x'])
  223. # update the rotation matrix W and the reconstruction matrix Y
  224. W = R @ W
  225. Y = R @ Y
  226. i += 1
  227. def plot_ica_reconstruction(data, labels=None, *args, **kwargs):
  228. """Plotting function for ICA reconstruction
  229. Parameters
  230. --------
  231. data: List[np.ndarray]
  232. Matrices to be plotted.
  233. titles: Union[List, Str, NoneType], optional (default: `None`)
  234. Corresponding titles, if present
  235. *args, **kwargs:
  236. additional arguments for `sns.distplot`
  237. Returns
  238. --------
  239. None
  240. """
  241. plt.close('all')
  242. n_sources, n_mat = data[0].shape[0], len(data)
  243. for i, d in enumerate(data):
  244. assert d.shape[0] == n_sources, f'Wrong number of features for `data[{i}].shape[0]` == `{d.shape[0]}` != `{n_sources}`.'
  245. if labels is not None and len(labels) != n_mat:
  246. print(f'Inconsistent number of titles given `{len(labels)}` != `{n_mat}`, showing no labels.')
  247. labels = None
  248. fig, axes = plt.subplots(nrows=n_sources, ncols=n_mat, figsize=(4 * n_mat, 4 * n_sources))
  249. if not isinstance(axes, np.ndarray):
  250. axes = np.array([[axes]])
  251. elif axes.ndim != 2:
  252. # treat only 1 source specifically
  253. axes = np.expand_dims(axes, axis=(n_sources) != 1)
  254. for i, row in enumerate(axes):
  255. for j, (A, ax) in enumerate(zip(data, row)):
  256. sns.distplot(A[i, :], *args, ax=ax, kde=False,
  257. axlabel='{}_{}'.format(labels[j], i) if labels is not None else None,
  258. **kwargs)
  259. fig.suptitle("Non-negative ICA")
  260. fig.tight_layout(rect=[0, 0, 1, 0.97])
  261. fig.show()

main.py at commit 27c801b, under BSD-3-Clause · at the source

Overview

Authors: Huada Tang1, Junyu Liu1, Xiying Cai1, Fangda Leng1, Jiaqi Hu1, Yang Zhao1, Zhaoxia Wang1,2, Lei Yu3
  1. Department of Neurology, Peking University First Hospital, 8 Xishiku Street, Xicheng District, Beijing, 100034, China
  2. Beijing Key Laboratory of Neurovascular Disease Discovery, Peking University First Hospital, 8 Xishiku Street, Xicheng District, Beijing, 100034, China
  3. Department of Radiology, Peking University First Hospital, 8 Xishiku Street, Xicheng District, Beijing, 100034, China
Institutions: Peking University First Hospital (China)
Journal: Neuroimage. Reports, volume 6, issue 3, article 100365
Dates: received 13 May 2025; accepted 5 June 2026; published online 24 June 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.ynirp.2026.100365 · PMID 42389051 · PMCID PMC13320026 · OpenAlex W7165810767
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), stroke (population), clinical / translational (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Preprocessing
Keywords: MELAS syndrome/complications/∗diagnosis/∗physiopathology, Magnetic resonance imaging, Stroke-like lesions, Non-negative independent component analysis/nnICA, Spreading pattern
Topic: Mitochondrial Function and Pathology (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: Peking University First Hospital
Citations: not cited yet (Europe PMC); 33 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.

Marius1311/Non-negative-ICA

License: BSD-3-Clause
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 27c801b5b73c7fb954fd0a5fbaa41fe6da424d96, 6 December 2019
Languages: Python (1), Jupyter (1)
Size: 5 files, 2 scripts
Software Heritage: not archived
Found in: the text, “Non-negative ICA”
Holds: README, license file, 1 notebook
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (2 files), NumPy (2 files), seaborn (2 files), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
4 files

DlutMedimgGroup/Chinese-Brain-PET-Template

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: a65f5379cd121d577c51326d9434c329b0491650, 28 November 2021
Languages: MATLAB (9)
Size: 14 files, 9 scripts
Software Heritage: not archived
Found in: the text, “Probabilistic map's correlation with synaptic de”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
11 files

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;
  • 11 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

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

Availability statements

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

  • they say that the data are available on request

Read them in the paper: doi.org/10.1016/j.ynirp.2026.100365.

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 2, 28 September 2026

  • Authors: added Huada Tang (0009-0002-5900-4551); Junyu Liu (0009-0006-8960-6325); Fangda Leng (0000-0002-1691-3811); removed Huada Tang; Junyu Liu; Fangda Leng

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 5 keywords, 1 funder, 31 references.

Cite

This paper

Tang, H., Liu, J., Cai, X., Leng, F., Hu, J., Zhao, Y., Wang, Z., & Yu, L. (2026). Analysis of acute stroke-like lesions in MELAS: Distribution, potential boundaries and spreading pattern. Neuroimage. Reports, 6(3), 100365. https://doi.org/10.1016/j.ynirp.2026.100365

BibTeX

@article{tang2026analysis,
author = {Tang, Huada and Liu, Junyu and Cai, Xiying and Leng, Fangda and Hu, Jiaqi and Zhao, Yang and Wang, Zhaoxia and Yu, Lei},
title = {{Analysis of acute stroke-like lesions in MELAS: Distribution, potential boundaries and spreading pattern}},
journal = {Neuroimage. Reports},
year = {2026},
month = jun,
volume = {6},
number = {3},
pages = {100365},
publisher = {Elsevier},
issn = {2666-9560},
doi = {10.1016/j.ynirp.2026.100365},
url = {https://doi.org/10.1016/j.ynirp.2026.100365},
pmid = {42389051},
pmcid = {PMC13320026}
}

RIS

TY - JOUR
AU - Tang, Huada
AU - Liu, Junyu
AU - Cai, Xiying
AU - Leng, Fangda
AU - Hu, Jiaqi
AU - Zhao, Yang
AU - Wang, Zhaoxia
AU - Yu, Lei
TI - Analysis of acute stroke-like lesions in MELAS: Distribution, potential boundaries and spreading pattern
T2 - Neuroimage. Reports
J2 - Neuroimage Rep
PY - 2026
DA - 2026/06/24
VL - 6
IS - 3
SP - 100365
SN - 2666-9560
PB - Elsevier
DO - 10.1016/j.ynirp.2026.100365
UR - https://doi.org/10.1016/j.ynirp.2026.100365
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.ynirp.2026.100365",
"type": "article-journal",
"title": "Analysis of acute stroke-like lesions in MELAS: Distribution, potential boundaries and spreading pattern",
"container-title": "Neuroimage. Reports",
"author": [
{
"family": "Tang",
"given": "Huada"
},
{
"family": "Liu",
"given": "Junyu"
},
{
"family": "Cai",
"given": "Xiying"
},
{
"family": "Leng",
"given": "Fangda"
},
{
"family": "Hu",
"given": "Jiaqi"
},
{
"family": "Zhao",
"given": "Yang"
},
{
"family": "Wang",
"given": "Zhaoxia"
},
{
"family": "Yu",
"given": "Lei"
}
],
"container-title-short": "Neuroimage Rep",
"volume": "6",
"issue": "3",
"page": "100365",
"DOI": "10.1016/j.ynirp.2026.100365",
"PMID": "42389051",
"PMCID": "PMC13320026",
"ISSN": "2666-9560",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.ynirp.2026.100365",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
24
]
]
}
}

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.1038/s41586-026-10631-3 [code]
A prognostic human brain network for diffuse midline glioma.
Journal: Nature
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, clinical / translational, 1 reference
[2] doi:10.1002/hbm.70602 [code]
Neuroimaging Correlates of Post-Stroke Pain After Ischemic Stroke: Secondary Analysis of the INSPiRE-TMS Trial.
Journal: Human brain mapping
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, stroke, clinical / translational
[3] doi:10.1111/ene.70678 [code]
Who Falls After a Stroke? Evidence From a Prospective Stroke Cohort.
Journal: European journal of neurology
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, stroke, clinical / translational
[4] doi:10.1002/advs.202523009 [code]
Personalized Network-Guided Neuromodulation Enhances Human Working Memory.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, 1 reference
[5] doi:10.1371/journal.pbio.3003856 [code]
Aging and metabolism contribute separately to brain-body health.
Journal: PLoS biology
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, structural MRI / diffusion, clinical / translational
[6] doi:10.1162/imag.a.1264 [code]
Data-driven subtyping and staging of ALS: A multicenter, longitudinal, deformation-based morphometry study.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: SPM, seaborn, SciPy, 2 other tools, structural MRI / diffusion, clinical / translational, 1 reference
[7] doi:10.1002/mrm.70336 [code]
Offline Reconstruction of Diffusion MRI Acquisitions for Comparison Between Complex PCA-Based and AI-Based Denoising.
Journal: Magnetic resonance in medicine
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, structural MRI / diffusion
[8] doi:10.1016/j.xcrm.2026.102943 [code]
Parent-of-origin effects in Alzheimer's liability dissociate neurocognitive and cardiovascular traits in at-risk individuals.
Journal: Cell reports. Medicine
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, clinical / translational
[9] doi:10.1093/braincomms/fcag176 [code]
Tau topography subtypes account for clinical heterogeneity and longitudinal trajectories in early-onset Alzheimer's disease.
Journal: Brain communications
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, clinical / translational
[10] doi:10.1002/ana.78206 [code]
Multimodal Image Guidance in Subthalamic Deep Brain Stimulation for Parkinson's Disease.
Journal: Annals of neurology
In common: Tools for NIfTI and ANALYZE image (MATLAB), SPM, seaborn, 3 other tools, clinical / translational

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.