Multi-dimensional MRI representation and privileged learning approaches to functional outcome prediction for ischemic stroke patients.
The 1 match
- [1] § Methods › External validation dataset ↔ mrs_predict.py, lines 94–143 · score 0.64 · hot encoded, age, etiology, filling, BMI, NIHSS
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 · 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.1212/wnl.0000000000218472 [code]
- Lesion-Level Subtypes of White Matter Hyperintensity Evolution Beyond Spatial Location.Journal: NeurologyIn common: pandas, NumPy, stroke, structural MRI / diffusion, clinical / translational
- [2] doi:10.1093/braincomms/fcag309 [code]
- Neurovascular effects of tadalafil in patients with cerebral small vessel disease: ETLAS-2 substudy.Journal: Brain communicationsIn common: pandas, NumPy, stroke, structural MRI / diffusion, clinical / translational
- [3] doi:10.1080/07853890.2026.2685416 [code]
- Pulmonary and cerebral damage in COVID-19 survivors: is there any association?Journal: Annals of medicineIn common: pandas, NumPy, stroke, structural MRI / diffusion, clinical / translational
- [4] doi:10.1002/alz.71530 [code]
- Differential associations of plasma biomarkers with Alzheimer's disease and small vessel disease: A multimodal imaging study.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: pandas, NumPy, stroke, structural MRI / diffusion, clinical / translational
- [5] doi:10.2463/mrms.mp.2024-0149 [code]
- Image Distortion Correction for Diffusion MR Imaging Using a Transformer-based U-Net.Journal: Magnetic resonance in medical sciences : MRMS : an official journal of Japan Society of Magnetic Resonance in MedicineIn common: pandas, NumPy, stroke, structural MRI / diffusion, clinical / translational
- [6] doi:10.1002/advs.202515913 [code]
- Intravital Multimodal Imaging of Human Cortical Organoid Transplantation in a Mouse Model of Chronic Stroke.Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)In common: stroke, structural MRI / diffusion, 1 reference
- [7] doi:10.1038/s41467-026-76812-w [code]
- Assessing molecular, cellular and transcriptomic bases of laminar perfusion and cytoarchitecture coupling in the human cortex.Journal: Nature communicationsIn common: pandas, NumPy, stroke, structural MRI / diffusion
- [8] doi:10.1002/mrm.70514 [code]
- Brain Clearance of Contrast Agent in Intravenous DCE-MRI Is Measurable and Cannot Be Explained by Clearance Across the BBB Alone.Journal: Magnetic resonance in medicineIn common: pandas, NumPy, stroke, structural MRI / diffusion
- [9] doi:10.1016/j.nicl.2026.104001 [code]
- Effect of vascular lesion preprocessing on Brain Intensity AbNormality Classification Algorithm (BIANCA) white matter hyperintensity segmentation.Journal: NeuroImage. ClinicalIn common: pandas, NumPy, stroke, structural MRI / diffusion
- [10] doi:10.3389/fnagi.2026.1789408 [code]
- Biological brain aging, cognitive-motor decline and vascular risk: a multivariate imaging analysis of 40,579 individuals.Journal: Frontiers in aging neuroscienceIn common: pandas, NumPy, stroke, structural MRI / diffusion
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:b6073858620e4e2d…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
