A robust and reproducible automated MRI pipeline for quantifying tissue outcomes after experimental stroke in multi-center preclinical networks.
The 13 matches
- [1] § Methods › Automated image processing and analysis pipeline › Brain extraction › Traditional rule-based segmentation approach ↔ bin/SpanAuxSegmentBrainRule.sh, lines 1–50 · score 0.94 · Markov random field, Gradient magnitude, contrast enhancement, brain mask, brain extraction, Sobel
- [2] § Methods › Automated image processing and analysis pipeline › Estimation of swelling, atrophy, and midline shift ↔ bin/SpanAuxMidline.py, lines 1–49 · score 0.93 · brain volume laterality, atlas midline, midline CSF, shift metrics, right hemispheres, midline shift
- [3] § Methods › Automated image processing and analysis pipeline › Tissue, ventricle, and lesion segmentation ↔ bin/SpanAuxSegmentLesion.sh, lines 199–238 · score 0.85 · joint probability, threshold seed, lesion seeds, enforce, product, modality
- [4] § Methods › Automated image processing and analysis pipeline › Preprocessing and quality assessment ↔ bin/SpanMainRun.sh, lines 227–270 · score 0.84 · N4 bias field, decay rate, multi echo, exponential, relaxation, SNR
- [5] § Methods › Automated image processing and analysis pipeline › Estimation of swelling, atrophy, and midline shift ↔ bin/SpanAuxMidline.py, lines 1–49 · score 0.84 · standard atlas space, brain swelling, CSF mask, position, displacement, lateral
- [6] § Methods › Automated image processing and analysis pipeline › Tissue, ventricle, and lesion segmentation ↔ bin/SpanMainRun.sh, lines 376–421 · score 0.80 · multi modal, standard atlas space, seed, sigmoid, morphological, artifacts
- [7] § Methods › Automated image processing and analysis pipeline › Brain extraction › Modern neural network approach ↔ lib/unetseg/unetseg.py, lines 303–344 · score 0.71 · ADAM optimizer, augmentation, kernel, convolutional, architecture, batch
- [8] § Methods › Automated image processing and analysis pipeline › Atlas-based registration ↔ bin/SpanMainRun.sh, lines 319–374 · score 0.69 · rigid registration, native space, parameter map, transform, atlas, brain
- [9] § Methods › Automated image processing and analysis pipeline › Preprocessing and quality assessment ↔ bin/SpanAuxSegmentBrainRule.sh, lines 1–50 · score 0.69 · image intensity, NIfTI, resampling, background, noise, Otsu
- [10] § Methods › Automated image processing and analysis pipeline › Preprocessing and quality assessment ↔ bin/SpanMainRun.sh, lines 227–270 · score 0.66 · noise ratio, segmenting foreground, denoising, SNR, signal, intensity
- [11] § Methods › Automated image processing and analysis pipeline › Preprocessing and quality assessment ↔ bin/SpanAuxSegmentLesion.sh, lines 159–197 · score 0.58 · baseline signal, decay rate, voxels, maps, mask, volume
- [12] § Methods › SPAN MRI acquisition protocol ↔ bin/SpanAuxSegmentLesion.sh, lines 159–197 · score 0.53 · acute ischemic, diffusion, signal, voxel, ADC, lesion
- [13] § Methods › Automated image processing and analysis pipeline › Tissue, ventricle, and lesion segmentation ↔ bin/SpanMainRun.sh, lines 376–421 · score 0.51 · standard atlas space, boundaries, harmonization, species, threshold, ADC
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
Shell · 595 lines · 20 KB · other · 5 matches
- #! /usr/bin/env bash
- ##############################################################################
- #
- # SPAN Rodent MRI Analytics — Single-Case Processing Pipeline
- #
- # Purpose:
- # Main entry point for processing a single rodent brain MRI case through
- # the full SPAN analysis pipeline. Converts raw DICOM data into
- # quantitative stroke metrics including lesion volumes, midline shift,
- # and regional anatomical measurements.
- #
- # Pipeline stages (each is idempotent — skipped if output already exists):
- # 1. native.dicom — Copy and fix DICOM headers (merge ProtocolName/SeriesDescription)
- # 2. native.convert — Convert DICOM to NIfTI using dcm2niix; extract site metadata
- # 3. native.import — Identify modalities (ADC, T2, RARE); apply site-specific orientation
- # 4. native.denoise — Non-local means denoising (Otsu mask, slice-wise NLM)
- # 5. native.fit — Exponential decay fitting (S(TE) = alpha * exp(-beta * TE))
- # 6. native.mask — Brain extraction (U-Net for mice, rule-based morphology for rats)
- # 7. native.harm — Statistical harmonization of fitted parameter maps
- # 8. native.reg — Rigid registration to species-specific atlas using ANTs
- # 9. standard.fit/harm — Transform fitted/harmonized maps to atlas space
- # 10. standard.mask — Transform brain mask to atlas space; intersect with restriction mask
- # 11. standard.seg — Lesion and CSF segmentation using multi-modal thresholding
- # 12. standard.midline — Midline shift analysis (mm, percent, laterality indices)
- # 13. standard.label — Anatomical labeling (hemispheres, regions, tissue classes)
- # 14. standard.map — Compute quantitative metrics (volumes, intensities by region)
- # 15. standard.vis — Generate mosaic visualizations of segmentation overlays
- #
- # Inputs:
- # --case <dir> Case output directory (required; created if it doesn't exist)
- # --source <dir> DICOM source directory (required on first run)
- # --species <str> Species: "mouse" or "rat" (default: auto-detected from path)
- # --correct <dir> Correction directory containing flipi/flipj/flipk flags (optional)
- #
- # Outputs:
- # Populates the case directory with subdirectories for each pipeline stage.
- # Key outputs include:
- # standard.map/*.csv — Quantitative metric tables
- # standard.vis/*.png — Mosaic visualization images
- #
- # Dependencies:
- # dcm2niix, ANTs (N4BiasFieldCorrection), QIT, Python 3 + PyTorch (mice only)
- #
- # Author: Ryan Cabeen
- #
- ##############################################################################
- usage()
- {
- echo "
- Name: $(basename $0)
- Description:
- The SPAN Rodent MRI Analysis. This program performs lesion segment and
- quantification. The input should be a dicom directory.
- Usage:
- $(basename $0) [options} --case case_dir
- Optional Parameters:
- --source <dicom_dir>: specify the input dicom directory (required first time)
- --species <mouse|rat>: specify the species of the case (default=auto)
- --correct <correct_dir>: specify the correction directory (advanced)
- Author: Ryan Cabeen
- "
- exit 1
- }
- function check
- {
- if [ ! -e $1 ]; then
- "[error] required data not found: $1"
- exit 1
- fi
- }
- function runit
- {
- echo " running: $@"
- $@
- if [ $? != 0 ]; then
- echo "[error] command failed: $@"
- exit;
- fi
- }
- data="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../data && pwd)"
- workflow="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- name=$(basename $0)
- qitcmd="qit --verbose --debug"
- species=""
- source=""
- correct=""
- case=""
- posit=""
- while [ "$1" != "" ]; do
- case $1 in
- --source) shift; source=$1 ;;
- --correct) shift; correct=$1 ;;
- --case) shift; case=$1 ;;
- --species) shift; species=$1 ;;
- --help ) usage ;;
- * ) posit="${posit} $1" ;;
- esac
- shift
- done
- if [ $(echo ${posit} | wc -w) -ne 0 ]; then echo "unexpected positional arguments: ${posit}"; usage; fi
- if [ ""${case} == "" ]; then echo "no case provided"; usage; fi
- # Auto-detect species from the case directory path. The standard directory
- # layout uses process/{mouse,rat}/{early,late}/subject_id, so a path
- # containing "rat" or "mouse" indicates the species. Falls back to mouse.
- if [[ "${species}" == "" ]]; then
- abscase="$(cd "$(dirname ${case})" && pwd)/$(basename ${case})"
- echo " detecting species from case path"
- if [[ "${case}" == *rat* ]]; then species="rat"; fi
- if [[ "${case}" == *mouse* ]]; then species="mouse"; fi
- if [[ "${species}" == "" ]]; then
- echo " no species detected, defaulting to mouse"
- species="mouse"
- fi
- fi
- ##############################################################################
- # Processing
- ##############################################################################
- echo "started ${name}"
- # Stage 1: Copy DICOM source into the case directory and fix headers.
- # The header fix merges ProtocolName and SeriesDescription fields so that
- # dcm2niix can produce consistent, informative filenames during conversion.
- if [ ""${source} != "" ]; then
- if [ ! -e ${case}/native.dicom ]; then
- echo " using source: ${source}"
- mkdir -p ${case}
- tmp=${case}/native.dicom.tmp.${RANDOM}
- cp -r ${source} ${tmp}
- chmod -R u+w ${tmp}
- runit bash ${workflow}/SpanAuxDicomFix.sh ${tmp}
- mv ${tmp} ${case}/native.dicom
- fi
- fi
- # Check for axis-flip corrections. If the correction directory contains
- # files named flipi, flipj, or flipk, the corresponding axis will be
- # flipped during import to correct acquisition orientation errors.
- flips=""
- for c in flipi flipj flipk; do
- if [ -e ${correct}/${c} ]; then
- flips="${flips} ${c}"
- fi
- done
- cd ${case}
- echo " using case: ${PWD}"
- echo " using species: ${species}"
- check native.dicom
- # Stage 2: Convert DICOM to NIfTI format using dcm2niix.
- # Extracts site name from DICOM JSON metadata and builds an image index
- # CSV cataloging all scans with their acquisition parameters.
- # Output: native.convert/nifti/*.nii.gz, native.convert/site.txt, native.convert/images.csv
- if [ -e native.dicom ] && [ ! -e native.convert ]; then
- tmp=native.convert.tmp.${RANDOM}
- runit bash ${workflow}/SpanAuxConvert.sh native.dicom ${tmp}
- mv ${tmp} native.convert
- fi
- # Stage 3: Import and organize converted images into a standardized format.
- # Identifies ADC, T2, and RARE modalities by filename patterns. Applies
- # site-specific image orientation (from params/<site>/orient.json) and
- # resamples to a common geometry. Applies any axis-flip corrections.
- # Output: native.import/{adc,t2,rare}.nii.gz, native.import/{adc,t2}.txt (echo times)
- if [ -e native.convert ] && [ ! -e native.import ]; then
- tmp=native.import.tmp.${RANDOM}
- runit bash ${workflow}/SpanAuxImport.sh native.convert ${tmp}
- for c in ${flips}; do
- for v in adc t2; do
- echo " correcting ${v} with ${c}"
- runit mv ${tmp}/${v}.nii.gz ${tmp}/${v}.raw.nii.gz
- runit ${qitcmd} VolumeReorder \
- --${c} \
- --input ${tmp}/${v}.raw.nii.gz \
- --output ${tmp}/${v}.nii.gz
- done
- done
- mv ${tmp} native.import
- fi
- # Stage 4: Denoise the multi-echo ADC and T2 volumes.
- # Uses Otsu thresholding to create a foreground mask, then applies non-local
- # means (NLM) filtering slice-by-slice (h=0.1, relative mode) to reduce
- # noise while preserving edges. Echo time files are copied through unchanged.
- # Output: native.denoise/{adc,t2}.nii.gz, native.denoise/{adc,t2}.txt
- if [ ! -e native.denoise ]; then
- tmp=native.denoise.tmp.${RANDOM}
- mkdir -p ${tmp}
- for p in adc t2; do
- runit bash ${workflow}/SpanAuxDenoise.sh \
- native.import/${p}.nii.gz ${tmp}/${p}.nii.gz
- done
- runit cp native.import/t2.txt ${tmp}
- runit cp native.import/adc.txt ${tmp}
- mv ${tmp} native.denoise
- fi
- # Stage 5: Fit exponential decay model to multi-echo data.
- # For each modality (ADC, T2), fits S(TE) = alpha * exp(-beta * TE) where:
- # alpha (base) = signal amplitude at TE=0
- # beta (rate) = decay rate (related to tissue relaxation/diffusion)
- # rmse = root mean square fitting error
- # snr = signal-to-noise ratio of the fit
- # The --skipFirstThresh 7 parameter skips the first echo if its intensity
- # exceeds 7x the second echo, which handles T2* contamination artifacts.
- # Also computes the mean across echoes (with N4 bias field correction)
- # and a foreground mask with QA report for each modality.
- # Output: native.fit/{adc,t2}_{base,rate,rmse,snr,mean,mask}.nii.gz
- if [ ! -e native.fit ]; then
- tmp=native.fit.tmp.${RANDOM}
- mkdir -p ${tmp}
- for m in adc t2; do
- runit ${qitcmd} VolumeExpDecayFit \
- --skipFirstThresh 7 \
- --input native.denoise/${m}.nii.gz \
- --varying native.denoise/${m}.txt \
- --outputAlpha ${tmp}/${m}_base.nii.gz \
- --outputBeta ${tmp}/${m}_rate.nii.gz \
- --outputError ${tmp}/${m}_rmse.nii.gz \
- --outputSnr ${tmp}/${m}_snr.nii.gz
- runit ${qitcmd} VolumeReduce \
- --method Mean \
- --input native.denoise/${m}.nii.gz \
- --output ${tmp}/${m}_mean.nii.gz
- for p in mean; do
- runit N4BiasFieldCorrection \
- -i ${tmp}/${m}_${p}.nii.gz \
- -w ${tmp}/${m}_${p}.nii.gz \
- -o ${tmp}/${m}_${p}.nii.gz
- done
- runit ${qitcmd} VolumeSegmentForeground \
- --input native.denoise/${m}.nii.gz \
- --output ${tmp}/${m}_mask.nii.gz \
- --report ${tmp}/${m}_report.csv
- done
- mv ${tmp} native.fit
- fi
- # Stage 6: Brain extraction (skull stripping).
- # Uses species-specific strategies:
- # Mouse: Tri-planar 2D U-Net deep learning model that fuses T2 and ADC
- # parameter maps (4 channels: t2_base, t2_rate, adc_base, adc_rate)
- # Rat: Rule-based morphological pipeline on ADC baseline image (foreground
- # detection → contrast enhancement → gradient edges → graph
- # segmentation → morphological cleanup → MRF-EM refinement)
- # Output: native.mask/brain.mask.nii.gz
- if [ ! -e native.mask/brain.mask.nii.gz ]; then
- tmp=native.mask.tmp.${RANDOM}
- mkdir -p ${tmp}
- # We only have a deep learning brain extractor for mice
- if [ ${species} == "mouse" ]; then
- runit bash ${workflow}/SpanAuxSegmentBrainLearn.sh \
- native.fit ${tmp}/brain.mask.nii.gz
- else
- runit bash ${workflow}/SpanAuxSegmentBrainRule.sh \
- native.fit ${tmp}/brain.mask.nii.gz
- fi
- mv ${tmp} native.mask
- fi
- # Stage 7: Statistical harmonization of fitted parameter maps.
- # Normalizes each parameter map (adc_base, adc_rate, t2_base, t2_rate) to
- # have zero mean and unit variance within the brain mask. This reduces
- # inter-site and inter-scanner variability in the quantitative maps.
- # Output: native.harm/{adc,t2}_{base,rate}.nii.gz
- if [ ! -e native.harm ]; then
- tmp=native.harm.tmp.${RANDOM}
- mkdir -p ${tmp}
- for p in {adc,t2}_{base,rate}; do
- runit ${qitcmd} VolumeHarmonize \
- --input native.fit/${p}.nii.gz \
- --inputStatMask native.mask/brain.mask.nii.gz \
- --output ${tmp}/${p}.nii.gz
- done
- mv ${tmp} native.harm
- fi
- # Stage 8: Register native-space brain to species-specific atlas.
- # Extracts the brain-masked harmonized T2 rate map as the registration
- # target, then performs rigid registration to the atlas brain template
- # using ANTs. The rigid transform preserves brain shape while aligning
- # orientation and position.
- # Output: native.reg/xfm.txt (affine transform matrix)
- if [ ! -e native.reg ]; then
- tmp=native.reg.tmp.${RANDOM}
- mkdir -p ${tmp}
- echo "extracting registration target"
- runit ${qitcmd} VolumeMask \
- --input native.harm/t2_rate.nii.gz \
- --mask native.mask/brain.mask.nii.gz \
- --output ${tmp}/native.nii.gz
- echo "performing registration"
- runit ${qitcmd} VolumeRegisterLinearAnts \
- --rigid \
- --input ${tmp}/native.nii.gz \
- --ref ${data}/${species}/brain.nii.gz \
- --output ${tmp}/work
- mv ${tmp}/work/* ${tmp}
- rm -rf ${tmp}/work
- mv ${tmp} native.reg
- fi
- # Stage 9: Transform fitted and harmonized parameter maps to standard atlas space.
- # Applies the rigid transform from registration to warp each parameter map
- # (t2_base, t2_rate, adc_base, adc_rate) into the atlas coordinate system.
- # Output: standard.fit/{t2,adc}_{base,rate}.nii.gz, standard.harm/{t2,adc}_{base,rate}.nii.gz
- for p in fit harm; do
- if [ ! -e standard.${p} ]; then
- tmp=standard.${p}.tmp.${RANDOM}
- mkdir -p ${tmp}
- for m in {t2,adc}_{base,rate}; do
- runit ${qitcmd} VolumeTransform \
- --input native.${p}/${m}.nii.gz \
- --affine native.reg/xfm.txt \
- --reference ${data}/${species}/brain.nii.gz \
- --output ${tmp}/${m}.nii.gz
- done
- mv ${tmp} standard.${p}
- fi
- done
- # Stage 10: Transform brain mask to standard atlas space.
- # Warps the native brain mask using the registration transform, applies
- # a mode filter to clean up interpolation artifacts, then intersects with
- # the atlas restriction mask to remove any regions outside the expected
- # brain boundary.
- # Output: standard.mask/brain.mask.nii.gz
- if [ ! -e standard.mask ]; then
- tmp=standard.mask.tmp.${RANDOM}
- mkdir -p ${tmp}
- runit ${qitcmd} MaskTransform \
- --input native.mask/brain.mask.nii.gz \
- --affine native.reg/xfm.txt \
- --reference ${data}/${species}/brain.nii.gz \
- --output ${tmp}/raw.mask.nii.gz
- runit ${qitcmd} MaskFilterMode \
- --input ${tmp}/raw.mask.nii.gz \
- --output ${tmp}/filter.mask.nii.gz
- runit ${qitcmd} MaskIntersection \
- --left ${tmp}/filter.mask.nii.gz \
- --right ${data}/${species}/restrict.mask.nii.gz \
- --output ${tmp}/brain.mask.nii.gz
- mv ${tmp} standard.mask
- fi
- # Stage 11: Segment lesion and CSF in standard atlas space.
- # Uses multi-modal sigmoid thresholding on harmonized T2 rate, ADC rate,
- # and ADC base maps to estimate lesion probability. Applies a two-threshold
- # seed-and-grow strategy (high threshold → morphological cleanup → dilate →
- # low threshold) for robust lesion delineation. CSF is segmented separately.
- # Results are intersected with the species-specific lesion prior mask.
- # Output: standard.seg/{lesion,tissue,csf}.mask.nii.gz, standard.seg/rois.nii.gz
- if [ ! -e standard.seg ]; then
- runit bash ${workflow}/SpanAuxSegmentLesion.sh \
- --input standard.harm \
- --mask standard.mask/brain.mask.nii.gz \
- --prior ${data}/${species}/lesion.mask.nii.gz \
- --output standard.seg
- fi
- # Stage 12: Compute midline shift metrics.
- # Identifies the centroid of CSF in the midline region, then measures
- # the displacement from the anatomical center. Computes shift in mm,
- # as a percentage of brain width, and laterality indices for tissue
- # and brain volumes. Splits the brain into hemispheres.
- # Output: standard.midline/map.csv, standard.midline/{brain,tissue}.hemis.mask.nii.gz
- if [ ! -e standard.midline ]; then
- runit ${qitcmd} ${workflow}/SpanAuxMidline.py \
- standard.mask/brain.mask.nii.gz \
- standard.seg/tissue.mask.nii.gz \
- standard.seg/csf.mask.nii.gz \
- ${data}/${species} \
- standard.midline
- fi
- # Stage 13: Create anatomical label volumes by combining tissue classes,
- # hemispheres, and atlas regions. Produces combinatorial label volumes:
- # classes — tissue(1), csf(2), lesion(3)
- # hemis — left(1), right(2) hemispheres
- # hemis_classes — hemisphere × tissue class
- # classes_regions — tissue class × anatomical region (cortex, striatum, etc.)
- # hemis_classes_regions — hemisphere × tissue class × region
- # Output: standard.label/{classes,hemis,hemis_classes,...}.nii.gz and .csv
- if [ ! -e standard.label ]; then
- tmp=standard.label.tmp.${RANDOM}
- mkdir -p ${tmp}
- runit cp standard.seg/rois.nii.gz ${tmp}/classes.nii.gz
- runit cp standard.seg/rois.csv ${tmp}/classes.csv
- runit cp standard.midline/brain.hemis.mask.nii.gz ${tmp}/hemis.nii.gz
- runit cp ${data}/${species}/hemis.csv ${tmp}/hemis.csv
- runit ${qitcmd} MaskProduct\
- --left ${data}/${species}/regions.nii.gz \
- --right ${tmp}/classes.nii.gz \
- --output ${tmp}/classes_regions.nii.gz
- runit ${qitcmd} MaskProduct\
- --left ${tmp}/hemis.nii.gz \
- --right ${tmp}/classes_regions.nii.gz \
- --output ${tmp}/hemis_classes_regions.nii.gz
- runit ${qitcmd} MaskProduct\
- --left ${tmp}/hemis.nii.gz \
- --right ${tmp}/classes.nii.gz \
- --output ${tmp}/hemis_classes.nii.gz
- mv ${tmp} standard.label
- fi
- # Stage 14: Compute quantitative metric tables.
- # Copies QA reports (SNR) from native fitting, midline shift metrics, and
- # computes regional statistics: mean/std of each parameter map within each
- # label combination (hemisphere × tissue class × region). Also computes
- # volumetric measurements for each label combination.
- # Output: standard.map/{midline,adc_qa,t2_qa,volumetrics_by_*,...}.csv
- if [ ! -e standard.map ]; then
- tmp=standard.map.tmp.${RANDOM}
- mkdir -p ${tmp}
- for f in adc t2; do
- cp native.fit/${f}_report.csv ${tmp}/${f}_qa.csv
- done
- cp standard.midline/map.csv ${tmp}/midline.csv
- for label in classes hemis_classes; do
- runit ${qitcmd} MaskRegionsMeasure \
- --basic \
- --regions standard.label/${label}.nii.gz \
- --lookup standard.label/${label}.csv \
- --volume ${label}_adc_rate=standard.fit/adc_rate.nii.gz \
- ${label}_t2_rate=standard.fit/t2_rate.nii.gz \
- ${label}_adc_base=standard.fit/adc_base.nii.gz \
- ${label}_t2_base=standard.fit/t2_base.nii.gz \
- ${label}_adc_rate_harm=standard.harm/adc_rate.nii.gz \
- ${label}_t2_rate_harm=standard.harm/t2_rate.nii.gz \
- ${label}_adc_base_harm=standard.harm/adc_base.nii.gz \
- ${label}_t2_base_harm=standard.harm/t2_base.nii.gz \
- --mask standard.mask/brain.mask.nii.gz \
- --output ${tmp}
- done
- for n in classes hemis hemis_classes classes_regions hemis_classes_regions; do
- runit ${qitcmd} MaskMeasure \
- --input standard.label/${n}.nii.gz \
- --lookup standard.label/${n}.csv \
- --output ${tmp}/volumetrics_by_${n}.csv
- done
- mv ${tmp} standard.map
- fi
- # Helper function for generating label overlay visualizations.
- # Renders a label mask on top of a background parameter map using pastel
- # colors, then creates a coronal mosaic image (every other slice) as a PNG.
- # Args: $1=background volume, $2=param name, $3=label name, $4=output dir
- function visit
- {
- runit ${qitcmd} VolumeRender \
- --bghigh 3.0 \
- --alpha 1.0 \
- --discrete pastel \
- --background ${1} \
- --labels ${4}/${3}.nii.gz \
- --output ${4}/${2}_${3}.nii.gz
- runit ${qitcmd} VolumeMosaic \
- --crop :,start:2:end,: \
- --rgb --axis j \
- --input ${4}/${2}_${3}.nii.gz \
- --output ${4}/${2}_${3}.png
- rm ${4}/${2}_${3}.nii.gz
- }
- # Stage 15: Generate mosaic visualizations.
- # Creates edge-outlined versions of brain, lesion, CSF, ROI, and hemisphere
- # labels (MaskShell), then overlays each on the harmonized ADC and T2 rate
- # maps as coronal mosaic PNGs for quality control review.
- # Output: standard.vis/{adc,t2}_rate_{anatomy,brain,lesion,csf,rois,hemis}.png
- if [ ! -e standard.vis ]; then
- tmp=standard.vis.tmp.${RANDOM}
- mkdir -p ${tmp}
- runit ${qitcmd} MaskShell \
- --mode Multi \
- --input standard.label/hemis.nii.gz \
- --output ${tmp}/hemis.nii.gz
- runit ${qitcmd} MaskShell \
- --mode Multi \
- --input standard.seg/rois.nii.gz \
- --output ${tmp}/rois.nii.gz
- runit ${qitcmd} MaskShell \
- --input standard.seg/lesion.mask.nii.gz \
- --output ${tmp}/lesion.nii.gz
- runit ${qitcmd} MaskShell \
- --input standard.seg/csf.mask.nii.gz \
- --output ${tmp}/csf.nii.gz
- runit ${qitcmd} MaskShell \
- --input standard.mask/brain.mask.nii.gz \
- --output ${tmp}/brain.nii.gz
- runit ${qitcmd} MaskSet --clear \
- --input ${tmp}/brain.nii.gz \
- --output ${tmp}/anatomy.nii.gz
- for labels in anatomy brain lesion csf rois hemis; do
- for param in {adc,t2}_rate; do
- visit standard.harm/${param}.nii.gz ${param} ${labels} ${tmp}
- done
- done
- rm ${tmp}/*.nii.gz
- mv ${tmp} standard.vis
- fi
- echo "finished"
- ################################################################################
- # END
- ################################################################################
SpanMainRun.sh at commit 9b425a0, under other · at the source
Overview
18 affiliations
- Laboratory of Neuro Imaging, USC Mark and Mary Stevens Institute for Neuroimaging and Informatics, Keck School of Medicine of USC, University of Southern California, Los Angeles, CA, United States
- Department of Radiology, Massachusetts General Hospital, Harvard Medical School, Charlestown, MA, United States
- Department of Physiology and Neuroscience, Zilkha Neurogenetic Institute of the Keck School of Medicine of USC, Los Angeles, CA, United States
- Department of Radiology and Biomedical Imaging, Yale University, New Haven, CT, United States
- Department of Emergency Medicine, University of California, San Diego, La Jolla, CA, United States
- Department of Orthopaedic Surgery, University of California, San Diego, La Jolla, CA, United States
- Icahn School of Medicine at Mount Sinai, New York, NY, United States
- Department of Biomedical Engineering, Yale University, New Haven, CT, United States
- Department of Radiology, University of Iowa, Iowa City, IA, United States
- Department of Biochemistry and Molecular Biology, Medical College of Georgia at Augusta University, Augusta, GA, United States
- Georgia Cancer Center, Augusta University, Augusta, CA, United States
- Department of Diagnostic and Interventional Imaging, The University of Texas McGovern Medical School at Houston, Houston, TX, United States
- F.M. Kirby Research Center for Functional Brain Imaging, Kennedy Krieger Research Institute, Baltimore, MD, United States
- Russell H. Morgan Department of Radiology and Radiological Science, Johns Hopkins University School of Medicine, Baltimore, MD, United States
- Department of Radiology, Duke University Medical Center, Durham, NC, United States
- Department of Neurology, Medical College of Georgia at Augusta University, Augusta, GA, United States
- Department of Neurology, Keck School of Medicine of USC, Los Angeles, CA, United States
- Department of Neurology, Massachusetts General Hospital, Harvard Medical School, Charlestown, MA, United States
Abstract
The failure to translate promising preclinical stroke therapies into clinical success is a multi-faceted problem; however, a critical contributing factor is the lack of rigorous, reproducible preclinical outcome measures. While magnetic resonance imaging (MRI) offers a translational alternative to traditional histology, its use in large, multi-site trials is challenged by data heterogeneity and the need for scalable analysis. To address this, we developed and validated a fully automated, open-source image analysis pipeline for the Stroke Preclinical Assessment Network (SPAN), a six-center preclinical trial network. The pipeline processed T2-weighted and apparent diffusion coefficient (ADC) maps from over 2,000 mice and rats, incorporating steps for cross-site data harmonization, deep learning-based brain extraction, and rule-based segmentation to quantify infarct volume, brain swelling, and atrophy. The pipeline demonstrated high accuracy, as automated lesion volumes strongly correlated with manual expert tracing on both MRI (R = 0.96) and 2,3,5-triphenyl-tetrazol
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 13 matches between paragraphs and lines of code.
cabeen/span-mri
9b425a07a28a908162fc89de1b1ccd134abf5963, 18 September 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
37 files
- bin/
SpanAuxConvert.sh , Shell, 142 lines - bin/
SpanAuxConvertAll.sh , Shell, 79 lines - bin/
SpanAuxDenoise.sh , Shell, 89 lines - bin/
SpanAuxDicomFix.sh , Shell, 94 lines - bin/
SpanAuxExport.sh , Shell, 130 lines - bin/
SpanAuxImport.sh , Shell, 164 lines - bin/
SpanAuxImportIda.sh , Shell, 114 lines - bin/
SpanAuxMidline.py , Python, 238 lines, 2 matches - bin/
SpanAuxMidlineShift.sh , Shell, 156 lines - bin/
SpanAuxNormalizeTable.sh , Shell, 159 lines - bin/
SpanAuxSegmentBrain.sh , Shell, 175 lines - bin/
SpanAuxSegmentBrainLearn , Shell, 113 lines.sh - bin/
SpanAuxSegmentBrainRule. , Shell, 223 lines, 2 matchessh - bin/
SpanAuxSegmentEyes.sh , Shell, 115 lines - bin/
SpanAuxSegmentLesion.sh , Shell, 325 lines, 3 matches - bin/
SpanAuxSortIda.sh , Shell, 74 lines - bin/
SpanAuxSummarize.py , Python, 158 lines - bin/
SpanMainEvaluateLesion.s , Shell, 224 linesh - bin/
SpanMainFuse.sh , Shell, 109 lines - bin/
SpanMainGroup.sh , Shell, 163 lines - bin/
SpanMainGroupLesion.sh , Shell, 57 lines - bin/
SpanMainGroupVis.sh , Shell, 94 lines - bin/
SpanMainListComplete.sh , Shell, 52 lines - bin/
SpanMainListIncomplete.s , Shell, 32 linesh - bin/
SpanMainRun.sh , Shell, 595 lines, 5 matches - bin/
SpanMainRunAll.sh , Shell, 69 lines - demo/
run_demo.sh , Shell, 142 lines - lib/
unetseg/ , Python, 50 linespredict.py - lib/
unetseg/ , Shell, 18 linessetup.sh - lib/
unetseg/ , Python, 701 lines, 1 matchunetseg.py - tests/
helpers.sh , Shell, 232 lines - tests/
run_tests.sh , Shell, 99 lines - tests/
test_integration.sh , Shell, 227 lines - tests/
test_python.py , Python, 185 lines - tests/
test_unit.sh , Shell, 173 lines - LICENSE, License, 44 lines
- README.md, Text, 424 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;
- 35 scripts, each with its path and the digest of its content;
- 13 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
- doi:10.5061/
dryad.xd2547dpb , at Dryad; found in “Data and Code Availability”
Data and Code Availability
MRI data used in the present study are available for download at: https://
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, pages, dates, 24 authors, 8 keywords, 5 funders, 37 references.
Cite
This paper
Lynch, K. M., Cabeen, R. P., de Morais, A. L., Jin, X., Tarakci, E., Lamb, J., Sanganahalli, B. G., Mihailovic, J. M., Olivas-Garcia, Y., Berry, D. B., Diniz, M. A., Mandeville, J., Hyder, F., Thedens, D. R., Arbab, A., Huang, S., Bibic, A., Austin, W., Hu, B., . . . Ayata, C. (2026). A robust and reproducible automated MRI pipeline for quantifying tissue outcomes after experimental stroke in multi-center preclinical networks. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1328. https://
BibTeX
@article{lynch2026robust
author = {Lynch, Kirsten M and Cabeen, Ryan P and de Morais, Andreia Lopes and Jin, Xuyan and Tarakci, Erendiz and Lamb, Jessica and Sanganahalli, Basavaraju G and Mihailovic, Jelena M and Olivas-Garcia, Yamileck and Berry, David B and Diniz, Marcio A and Mandeville, Joseph and Hyder, Fahmeed and Thedens, Daniel R and Arbab, Ali and Huang, Shuning and Bibic, Adnan and Austin, Wyatt and Hu, Bingren and Khan, Mohammad B and Kamat, Pradip K and Toga, Arthur W and Lyden, Patrick and Ayata, Cenk},
title = {{A robust and reproducible automated MRI pipeline for quantifying tissue outcomes after experimental stroke in multi-center preclinical networks}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = aug,
volume = {4},
pages = {IMAG.a.1328},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/
url = {https://
pmid = {42577804},
pmcid = {PMC13455521}
}
RIS
TY - JOUR
AU - Lynch, Kirsten M
AU - Cabeen, Ryan P
AU - de Morais, Andreia Lopes
AU - Jin, Xuyan
AU - Tarakci, Erendiz
AU - Lamb, Jessica
AU - Sanganahalli, Basavaraju G
AU - Mihailovic, Jelena M
AU - Olivas-Garcia, Yamileck
AU - Berry, David B
AU - Diniz, Marcio A
AU - Mandeville, Joseph
AU - Hyder, Fahmeed
AU - Thedens, Daniel R
AU - Arbab, Ali
AU - Huang, Shuning
AU - Bibic, Adnan
AU - Austin, Wyatt
AU - Hu, Bingren
AU - Khan, Mohammad B
AU - Kamat, Pradip K
AU - Toga, Arthur W
AU - Lyden, Patrick
AU - Ayata, Cenk
TI - A robust and reproducible automated MRI pipeline for quantifying tissue outcomes after experimental stroke in multi-center preclinical networks
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/
VL - 4
SP - IMAG.a.1328
SN - 2837-6056
PB - MIT Press
DO - 10.1162/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1162/
"type": "article-journal",
"title": "A robust and reproducible automated MRI pipeline for quantifying tissue outcomes after experimental stroke in multi-center preclinical networks",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Lynch",
"given": "Kirsten M"
},
{
"family": "Cabeen",
"given": "Ryan P"
},
{
"family": "de Morais",
"given": "Andreia Lopes"
},
{
"family": "Jin",
"given": "Xuyan"
},
{
"family": "Tarakci",
"given": "Erendiz"
},
{
"family": "Lamb",
"given": "Jessica"
},
{
"family": "Sanganahalli",
"given": "Basavaraju G"
},
{
"family": "Mihailovic",
"given": "Jelena M"
},
{
"family": "Olivas-Garcia",
"given": "Yamileck"
},
{
"family": "Berry",
"given": "David B"
},
{
"family": "Diniz",
"given": "Marcio A"
},
{
"family": "Mandeville",
"given": "Joseph"
},
{
"family": "Hyder",
"given": "Fahmeed"
},
{
"family": "Thedens",
"given": "Daniel R"
},
{
"family": "Arbab",
"given": "Ali"
},
{
"family": "Huang",
"given": "Shuning"
},
{
"family": "Bibic",
"given": "Adnan"
},
{
"family": "Austin",
"given": "Wyatt"
},
{
"family": "Hu",
"given": "Bingren"
},
{
"family": "Khan",
"given": "Mohammad B"
},
{
"family": "Kamat",
"given": "Pradip K"
},
{
"family": "Toga",
"given": "Arthur W"
},
{
"family": "Lyden",
"given": "Patrick"
},
{
"family": "Ayata",
"given": "Cenk"
}
],
"container-title-short":
"volume": "4",
"page": "IMAG.a.1328",
"DOI": "10.1162/
"PMID": "42577804",
"PMCID": "PMC13455521",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
7
]
]
}
}
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/s41467-026-71918-7 [code]
- Developmental disinhibition gates language lateralization in childhood.Journal: Nature communicationsIn common: dcm2niix, NiBabel, PyTorch, 2 other tools, 1 reference
- [2] doi:10.1038/s41597-026-07184-5 [code]
- A Multiple Sclerosis MRI Dataset with Tri-Mask Annotations for Lesion Segmentation.Journal: Scientific dataIn common: dcm2niix, NiBabel, SciPy, 1 other tool, structural MRI / diffusion, 1 reference
- [3] doi:10.1016/j.isci.2026.115747 [code]
- Realistic PET image synthesis from MRI for automated inference of brain atrophy and Alzheimer's.Journal: iScienceIn common: dcm2niix, NiBabel, PyTorch, 2 other tools, structural MRI / diffusion
- [4] 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: NiBabel, PyTorch, SciPy, 1 other tool, structural MRI / diffusion, 2 references - [5] doi:10.3389/fmed.2026.1875760 [code]
- Adaptive multi-stage domain unlearning for white-matter lesion segmentation.Journal: Frontiers in medicineIn common: NiBabel, PyTorch, SciPy, 1 other tool, structural MRI / diffusion, 2 references
- [6] doi:10.1002/nbm.70353 [code]
- Automated Surface-Based Segmentation of Deep Gray Matter Regions Based on Diffusion Tensor Images Reveals Unique Age Trajectories Over the Healthy Lifespan.Journal: NMR in biomedicineIn common: dcm2niix, NiBabel, SciPy, 1 other tool, structural MRI / diffusion, 1 reference
- [7] doi:10.1016/j.phro.2026.101056 [code]
- Toward uncertainty-aware manual delineation of brain tumours using eye-tracking and image-derived features.Journal: Physics and imaging in radiation oncologyIn common: NiBabel, PyTorch, SciPy, 1 other tool, 2 references
- [8] doi:10.1038/s41597-026-07248-6 [code]
- A large-scale fMRI dataset for vision-language semantic association.Journal: Scientific dataIn common: dcm2niix, NiBabel, PyTorch, 2 other tools
- [9] doi:10.1038/s41467-026-71719-y [code]
- Brain functional-structural gradient coupling reflects development, behavior and genetic influences.Journal: Nature communicationsIn common: dcm2niix, NiBabel, PyTorch, 2 other tools
- [10] doi:10.1162/imag.a.1362 [code]
- Human fMRI at 11.7T: Assessing feasibility, stability, and reliability on the Iseult scanner.Journal: Imaging neuroscience (Cambridge, Mass.)In common: dcm2niix, NiBabel, SciPy, 1 other tool, 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, 35 scripts, and 13 matches 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:4b148233d0ec67c8…
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.
