Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients.
One block of code here has 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 1 match
- [1] § Methods › External validation dataset ↔ mrs_predict.py, lines 94 to 143 · score 0.64 · hot encoded, age, etiology, filling, BMI, NIHSS · block
oscr:b:XDCFVF363XFKV-Y· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 150 lines · 5.6 KB · no license · 1 match
- import pandas as pd
- import numpy as np
- import argparse
- import os
- from caller import call_mrs_prediction
- def main():
- df = load_clinical_data(args.data_path)
- df = df[df['gs_rankin_6isdeath'].notna() & (df['gs_rankin_6isdeath'] != 'n/a')]
- y = df.gs_rankin_6isdeath if args.mdl_type == 'regression' else df.gs_rankin_6isdeath > 2
- y = validate_y(y, args.mdl_type)
- assert len(df) == len(y), "Provided dataframe and output vector do not have the same length."
- x = preprocess_clinical_df(df)
- os.makedirs("output", exist_ok=True)
- x.to_csv(os.path.join('output', 'df.csv'), index=False)
- call_mrs_prediction(os.path.join('output', 'df.csv'), args.mdl_type)
- return
- def load_clinical_data(file_path):
- if not os.path.exists(file_path):
- raise FileNotFoundError(f"File does not exist: {file_path}")
- ext = os.path.splitext(file_path)[-1].lower()
- try:
- # CSV
- if ext == '.csv':
- df = pd.read_csv(file_path)
- # TSV or TXT (tab-separated)
- elif ext in ['.tsv', '.txt']:
- # Tries to infer delimiter if not standard
- with open(file_path, 'r') as f:
- line = f.readline()
- if '\t' in line:
- df = pd.read_csv(file_path, sep='\t')
- else:
- df = pd.read_csv(file_path)
- # Excel
- elif ext in ['.xls', '.xlsx']:
- df = pd.read_excel(file_path)
- # Parquet
- elif ext == '.parquet':
- df = pd.read_parquet(file_path)
- # Add more types here as needed, e.g. .json, .dta
- else:
- raise ValueError(f"Unsupported file extension '{ext}'. "
- "Supported types: .csv, .tsv, .txt, .xls, .xlsx, .parquet.")
- except Exception as e:
- raise IOError(f"Failed to read {file_path}: {e}")
- return df
- def validate_y(y, mdl_type):
- # Convert y to pandas Series for consistency
- y_ser = pd.Series(y)
- # 1. Check for missing values
- if y_ser.isnull().any():
- raise ValueError("y contains missing values. Please remove.")
- # 2. Classification
- if mdl_type == 'classification':
- unique_vals = y_ser.unique()
- if len(unique_vals) != 2:
- raise ValueError(f"For classification, y must be binary (found values: {list(unique_vals)}).")
- # Accept bools, [0, 1], or [True, False];
- # Try to convert; raise error if can't.
- try:
- y_bool = y_ser.astype(bool)
- except Exception as e:
- raise TypeError("For classification, y could not be converted to boolean. Error: {}".format(e))
- return y_bool
- # 3. Regression: integers 0–6, ordered categorical
- elif mdl_type == 'regression':
- try:
- y_int = y_ser.astype(int)
- except Exception as e:
- raise TypeError("For regression, y must be convertible to integer values from 0 to 6. Error: {}".format(e))
- # Ensure exact match
- if not (np.all(np.isin(y_int, np.arange(0, 7))) and np.all(y_ser == y_ser.astype(int))):
- raise ValueError("For regression, all y values must be integers between 0 and 6 (inclusive) without any fractions.")
- y_cat = pd.Categorical(y_int, categories=list(range(7)), ordered=True)
- return pd.Series(y_cat, index=y_ser.index)
- else:
- raise ValueError("mdl_type must be either 'classification' or 'regression'.")
- def preprocess_clinical_df(df):
- # Step 1: Drop specified columns
- cols_to_drop = ['participant_id', 'gs_rankin_6isdeath', 'etiology']
- df = df.drop(columns=cols_to_drop, errors='ignore')
- # Step 2: Remove any row with "n/a" in sex
- df = df[df['sex'] != 'n/a']
- # Step 3: Filter for acuteischaemicstroke == 1 and drop the column
- df = df[df['acuteischaemicstroke'] == 1]
- df = df.drop(columns=['acuteischaemicstroke'])
- # Step 4: Replace "n/a" with np.nan for all columns
- df = df.replace('n/a', np.nan)
- # Step 5: Standardize column names
- df = df.rename(columns={
- 'sex': 'Male_YN', # will handle this below
- 'age': 'Age',
- 'priorstroke': 'Stroke_Hx_YN',
- 'bmi': 'BMI_kgm2',
- 'nihss': 'NIHSS_Total_Initial'
- }, errors='ignore')
- # Step 6: Convert Male_YN column
- # Assuming M = male, F = female:
- if 'Male_YN' in df.columns:
- df['Male_YN'] = df['Male_YN'].map({'M': True, 'F': False})
- # Step 7: Convert Stroke_Hx_YN column to boolean
- if 'Stroke_Hx_YN' in df.columns:
- df['Stroke_Hx_YN'] = df['Stroke_Hx_YN'].map({1: True, 0: False, np.nan: np.nan})
- # Step 8: Race one-hot encoding
- races = {
- 'b': 'Race_BAA',
- 'w': 'Race_W'
- }
- # Create columns and fill with False
- for race_code, col_name in races.items():
- df[col_name] = df['race'].apply(lambda x: True if x == race_code else False if x in ['b', 'w'] else np.nan)
- # Drop the original race column
- df = df.drop(columns=['race'])
- # Step 9: Set correct dtypes (float for Age, BMI, NIHSS)
- for col in ['Age', 'BMI_kgm2', 'NIHSS_Total_Initial']:
- if col in df.columns:
- df[col] = pd.to_numeric(df[col], errors='coerce')
- return df
- if __name__ == '__main__':
- parser = argparse.ArgumentParser(description="3D Image Reconstruction from Embeddings")
- parser.add_argument('--data_path', required=True, help="Path to file containing clinical data.")
- parser.add_argument('--mdl_type', required=True, choices=['classification', 'regression'], help="\'classification\' or \'regression\'")
- args = parser.parse_args()
- main()
mrs_predict.py at commit 2525de5, no license · at the source
Overview
- Gilbert S. Omenn Computational Medicine and Bioinformatics, University of MIchigan, Ann Arbor, MI USA
- Department of Neurosurgery, Virginia Commonwealth University, Richmond, VA USA
- Department of Neurological Surgery, MIchigan Medicine, Ann Arbor, MI USA
- Department of Emergency Medicine, MIchigan Medicine, Ann Arbor, MI USA
- MIchigan Institute for Data and AI in Society (MIDAS), University of MIchigan, Ann Arbor, MI USA
- Center for Data-Driven Drug Development and Treatment Assessment (DATA), University of MIchigan, Ann Arbor, MI USA
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.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
kayvanlabs/ischemic_stroke_mrs_prediction
2525de52cbb2717ba74051bbc84d1c3b3398c140, 19 December 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
3 files
- caller.py, Python, 78 lines
- mrs_predict.py, Python, 150 lines, 1 match
- README.md, Text, 176 lines
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;
- 2 scripts, each with its path and the digest of its content;
- 1 match 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.
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:
- it points to the authors' code: kayvanlabs/
ischemic_stroke_mrs_pred iction
Read it in the paper: doi.org/10.1038/s41746-026-02708-0.
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, 6 authors, 4 keywords, 31 references.
Cite
This paper
Wittrup, E., Reavey-Cantwell, J., Pandey, A. S., Rivet II, D. J., Daou, B. J., & Najarian, K. (2026). Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients. NPJ digital medicine, 9(1), 557. https://
BibTeX
@article{wittrup2026mult
author = {Wittrup, Emily and Reavey-Cantwell, John and Pandey, Aditya S and Rivet II, Dennis J and Daou, Badih J and Najarian, Kayvan},
title = {{Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients}},
journal = {NPJ digital medicine},
year = {2026},
month = may,
volume = {9},
number = {1},
pages = {557},
publisher = {Nature Publishing Group},
issn = {2398-6352},
doi = {10.1038/
url = {https://
pmid = {42106496},
pmcid = {PMC13381960}
}
RIS
TY - JOUR
AU - Wittrup, Emily
AU - Reavey-Cantwell, John
AU - Pandey, Aditya S
AU - Rivet II, Dennis J
AU - Daou, Badih J
AU - Najarian, Kayvan
TI - Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients
T2 - NPJ digital medicine
J2 - NPJ Digit Med
PY - 2026
DA - 2026/
VL - 9
IS - 1
SP - 557
SN - 2398-6352
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients",
"container-title": "NPJ digital medicine",
"author": [
{
"family": "Wittrup",
"given": "Emily"
},
{
"family": "Reavey-Cantwell",
"given": "John"
},
{
"family": "Pandey",
"given": "Aditya S"
},
{
"family": "Rivet II",
"given": "Dennis J"
},
{
"family": "Daou",
"given": "Badih J"
},
{
"family": "Najarian",
"given": "Kayvan"
}
],
"container-title-short":
"volume": "9",
"issue": "1",
"page": "557",
"DOI": "10.1038/
"PMID": "42106496",
"PMCID": "PMC13381960",
"ISSN": "2398-6352",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
10
]
]
}
}
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.1186/s12880-025-01864-1 [code]
- AI post-intervention operational and functional outcomes prediction in ischemic stroke patients using MRIs.Journal: BMC medical imagingIn common: stroke, structural MRI / diffusion, clinical / translational, 14 references
- [2] doi:10.1007/s13534-025-00462-y [code]
- Automatic prediction of stroke treatment outcomes: latest advances and perspectives.Journal: Biomedical engineering lettersIn common: pandas, NumPy, stroke, clinical / translational, 9 references
- [3] doi:10.1038/s41598-025-21945-z [code]
- A multimodal multitask deep learning model for predicting stroke lesion and functional outcomes using 4D CTP imaging and clinical metadata.Journal: Scientific reportsIn common: stroke, clinical / translational, 5 references
- [4] doi:10.1007/s10143-023-02114-0 [code]
- Enhancing the prediction for shunt-dependent hydrocephalus after aneurysmal subarachnoid hemorrhage using a machine learning approach.Journal: Neurosurgical reviewIn common: pandas, NumPy, stroke, clinical / translational, 2 references
- [5] doi:10.3390/diagnostics13243604 [code]
- Deep Learning-Based Extraction of Biomarkers for the Prediction of the Functional Outcome of Ischemic Stroke Patients.Journal: Diagnostics (Basel, Switzerland)In common: pandas, NumPy, stroke, clinical / translational, 1 reference
- [6] doi:10.1038/s41597-024-03667-5 [code]
- The stroke outcome optimization project: Acute ischemic strokes from a comprehensive stroke center.Journal: Scientific dataIn common: pandas, NumPy, stroke, structural MRI / diffusion, 1 reference
- [7] doi:10.1109/jtehm.2024.3430035 [code]
- XAI-Based Assessment of the AMURA Model for Detecting Amyloid-β and Tau Microstructural Signatures in Alzheimer's Disease.Journal: IEEE journal of translational engineering in health and medicineIn common: pandas, NumPy, structural MRI / diffusion, clinical / translational, 1 reference
- [8] doi:10.1038/s41598-026-37069-x [code]
- Machine learning models powered by emergency medical services data enhance stroke triage in prehospital settings.Journal: Scientific reportsIn common: pandas, NumPy, stroke, clinical / translational, 1 reference
- [9] doi:10.1016/j.neuropsychologia.2025.109067 [code]
- From MRIcro to MRIcron: The evolution of neuroimaging visualization tools.Journal: NeuropsychologiaIn common: 2 references
- [10] doi:10.3390/tomography12030029 [code]
- Automated Multi-Modal MRI Segmentation of Stroke Lesions and Corticospinal Tract Integrity for Functional Outcome Prediction.Journal: Tomography (Ann Arbor, Mich.)In common: stroke, structural MRI / diffusion, clinical / translational, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:ce5e826551d1982c…
Add the badge to the code's README
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 -->
[](https://openscicode.org/badge/doi/10.1038/s41746-026-02708-0)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41746-026-02708-0.svg
:target: https://openscicode.org/badge/doi/10.1038/s41746-026-02708-0
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41746-026-02708-0"><img src="https://openscicode.org/badge/doi/10.1038/s41746-026-02708-0.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.
