OSCR

Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination.

Code ↔ Paper

8 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 8 matches · 2 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § The Intracortical Microstructure Profiling Workflow ↔ microstructure_profiling.sh, lines 198–264 · score 0.79 · co registered, equivolumetric surfaces, surface space, micro image, intracortical surfaces, microstructure profile
  2. [2] § The Intracortical Microstructure Profiling Workflow ↔ functions/generate_equivolumetric_surfaces.py, lines 94–108 · score 0.69 · volume fraction, cortical volume, equivolumetric surface, vertex
  3. [3] § The Intracortical Microstructure Profiling Workflow ↔ functions/compute_t1t2_ratio.sh, the whole file · a weak match · score 0.67 · ratio image, bias corrected, T2w image, micapipe, T1w, MRI
  4. [4] § The Intracortical Microstructure Profiling Workflow ↔ functions/compute_t1t2_ratio_predefined.sh, the whole file · a weak match · score 0.66 · ratio image, bias corrected, T2w image, micapipe, T1w, MRI
  5. [5] § The Intracortical Microstructure Profiling Workflow ↔ microstructure_profiling.sh, lines 198–264 · score 0.64 · generating equivolumetric, surface space, intracortical surfaces, microstructure profiles, FreeSurfer
  6. [6] § The Intracortical Microstructure Profiling Workflow ↔ functions/collate_MP.py, lines 60–92 · score 0.62 · cortical depths, u3, kurtosis, skewness, u4, u0
  7. [7] § The Intracortical Microstructure Profiling Workflow ↔ functions/collate_MP.py, lines 60–92 · score 0.53 · image intensities, cortical depths, SD, profile, microstructural
  8. [8] § The Intracortical Microstructure Profiling Workflow ↔ functions/compute_snr.sh, lines 1–39 · score 0.52 · T1 weighted imaging, micro image, computation, SPACE

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 · 403 lines · 18 KB · MIT · 2 matches

  1. #!/bin/bash
  2. # Auto-detect location of the toolbox bin directory
  3. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  4. TOOLBOX_BIN="${SCRIPT_DIR}/functions"
  5. export TOOLBOX_BIN
  6. # -----------------------------
  7. # Microstructure Profiling Toolbox Wrapper
  8. # -----------------------------
  9. show_help() {
  10. echo "Usage: $0 [--micro-image FILE] [--anat-dir DIR] --subject-id ID --subjects-dir DIR --output-dir DIR --fs-dir DIR --sing-dir DIR [--num_surfaces 14]"
  11. echo
  12. echo "Arguments:"
  13. echo " --micro-image FILE Path to a precomputed microstructural image (optional)"
  14. echo " --anat-dir DIR Path to a BIDS anat/ directory (optional, necessary for creation of T1wDividedByT2w image and cortical surface construction)"
  15. echo " --subject-id ID Subject ID (e.g., sub-001) [required]"
  16. echo " --subjects-dir DIR Path to Freesurfer-style SUBJECTS_DIR [required] (if the directory doesn't contain surfaces for the specified subject, Fastsurfer will be run)"
  17. echo " --output-dir DIR Output directory for toolbox results [required]"
  18. echo " --fs-dir DIR Path to the FreeSurfer directory [required] (should contain standard license file, 'license.txt')"
  19. echo " --sing-dir DIR Path to the directory with singularities [required] (must contain cortpro.sif and, if Freesurfer output is not yet available, fastsurfer_gpu.sif)"
  20. echo " --num-surfaces N Number of intracortical surfaces (default: 14)"
  21. echo " --surface-output NAME Name of standard surface for output, currently compatible with any fsaverage number (default: fsaverage5), native or fsLR32k"
  22. echo " --ratio-type NAME Type of image for ratio with T1w (default: T2w). In principle, accepts any BIDS suffix that is housed in anat"
  23. echo " --t1-file PATH Custom T1w (must be paired with --t2-file)"
  24. echo " --t2-file PATH Custom T2w (must be paired with --t1-file)"
  25. echo " --skip-bias-correct Option to turn off bias correction on T1w and T2w images"
  26. echo " --keep-inter-files Option to keep all intermediary files, which are otherwise removed in a final clean up"
  27. echo " --run-snr Option to compute SNR profiles"
  28. echo " -h, --help Display this help message"
  29. }
  30. # -----------------------------
  31. # Parse Arguments
  32. # -----------------------------
  33. MICRO_IMAGE=""
  34. ANAT_DIR=""
  35. SUBJECT_ID=""
  36. SUBJECTS_DIR=""
  37. OUTPUT_DIR=""
  38. FREESURFER_HOME=""
  39. SING_DIR=""
  40. NUM_SURFACES=14 # default
  41. SURF_OUT=fsaverage5 # default
  42. RATIO_TYPE=T2w # default
  43. T1_FILE=""
  44. T2_FILE=""
  45. SKIP_BC=0
  46. CLEAN_UP=1
  47. RUN_SNR=0
  48. RESLICE_MICRO=0
  49. REGISTER_T1=0
  50. while [[ $# -gt 0 ]]; do
  51. case "$1" in
  52. --micro-image)
  53. MICRO_IMAGE="$2"
  54. shift 2
  55. ;;
  56. --anat-dir)
  57. ANAT_DIR="$2"
  58. shift 2
  59. ;;
  60. --subject-id)
  61. SUBJECT_ID="$2"
  62. shift 2
  63. ;;
  64. --subjects-dir)
  65. SUBJECTS_DIR="$2"
  66. shift 2
  67. ;;
  68. --output-dir)
  69. OUTPUT_DIR="$2"
  70. shift 2
  71. ;;
  72. --fs-dir)
  73. FREESURFER_HOME="$2"
  74. shift 2
  75. ;;
  76. --sing-dir)
  77. SING_DIR="$2"
  78. shift 2
  79. ;;
  80. --num-surfaces)
  81. NUM_SURFACES="$2"
  82. shift 2
  83. ;;
  84. --surface-output)
  85. SURF_OUT="$2"
  86. shift 2
  87. ;;
  88. --ratio-type)
  89. RATIO_TYPE="$2"
  90. shift 2
  91. ;;
  92. --t1-file)
  93. T1_FILE="$2"
  94. shift 2
  95. ;;
  96. --t2-file)
  97. T2_FILE="$2"
  98. shift 2
  99. ;;
  100. --skip-bias-correct)
  101. SKIP_BC=1
  102. shift
  103. ;;
  104. --keep-inter-files)
  105. CLEAN_UP=0
  106. shift
  107. ;;
  108. --run-snr)
  109. RUN_SNR=1
  110. shift
  111. ;;
  112. -h|--help)
  113. show_help
  114. exit 0
  115. ;;
  116. *)
  117. echo "[ERROR] Unknown option: $1"
  118. show_help
  119. exit 1
  120. ;;
  121. esac
  122. done
  123. # -----------------------------
  124. # Validate Required Inputs
  125. # -----------------------------
  126. if [[ -z "$SUBJECT_ID" || -z "$SUBJECTS_DIR" || -z "$OUTPUT_DIR" || -z "$FREESURFER_HOME" || -z "$SING_DIR" ]]; then
  127. echo "[ERROR] --subject-id, --subjects-dir, --output-dir, --fs-dir and --sing-dir are all required."
  128. exit 1
  129. fi
  130. export FREESURFER_HOME
  131. export SUBJECTS_DIR
  132. export SING_DIR
  133. if ! command -v singularity &> /dev/null; then
  134. echo "[ERROR] Singularity not found - unable to continue"
  135. exit 1
  136. fi
  137. SING_IMG="$SING_DIR/cortpro.sif"
  138. if [[ ! -f $SING_IMG ]]; then
  139. echo "[ERROR] cortpro.sif not found at: $SING_DIR"
  140. exit 1
  141. fi
  142. # Validate NUM_SURFACES is a positive integer
  143. if ! [[ "$NUM_SURFACES" =~ ^[0-9]+$ ]]; then
  144. echo "[ERROR] --num-surfaces must be a positive integer."
  145. exit 1
  146. fi
  147. # Create output directory if needed
  148. mkdir -p "$OUTPUT_DIR"/"$SUBJECT_ID" || {
  149. echo "[ERROR] Failed to create output directory: "$OUTPUT_DIR"/"$SUBJECT_ID""
  150. exit 1
  151. }
  152. # -----------------------------
  153. # Compile microstructure image - creates new file with standardised naming for micro image in its native space (Nb: T1-space for T1w/T2w)
  154. # -----------------------------
  155. if [[ -n "$MICRO_IMAGE" ]]; then
  156. # pre-made micro image case
  157. echo "[INFO] Using precomputed microstructure image: $MICRO_IMAGE"
  158. cp ${MICRO_IMAGE} $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-micro.nii.gz
  159. elif [[ -n "$T1_FILE" || -n "$T2_FILE" ]]; then
  160. # predefined T1/T2 case
  161. if [[ -z "$T1_FILE" || -z "$T2_FILE" ]]; then
  162. echo "[ERROR] --t1-file and --t2-file must be provided together."
  163. exit 1
  164. fi
  165. if [[ ! -f "$T1_FILE" || ! -f "$T2_FILE" ]]; then
  166. echo "[ERROR] Provided T1 or T2 file does not exist."
  167. exit 1
  168. fi
  169. bash "$TOOLBOX_BIN/compute_t1t2_ratio_predefined.sh" \
  170. "$T1_FILE" "$T2_FILE" "$SUBJECT_ID" "$OUTPUT_DIR" "$SKIP_BC"
  171. cp "$OUTPUT_DIR"/"$SUBJECT_ID"/T1wDividedByT2w.nii.gz $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-micro.nii.gz
  172. REGISTER_T1=1
  173. else
  174. # BIDS-derived case
  175. if [[ -z "$ANAT_DIR" ]]; then
  176. echo "[ERROR] No --anat-dir provided to compute T1/T2 ratio."
  177. exit 1
  178. fi
  179. bash "$TOOLBOX_BIN/compute_t1t2_ratio.sh" \
  180. "$ANAT_DIR" "$SUBJECT_ID" "$OUTPUT_DIR" "$RATIO_TYPE" "$SKIP_BC"
  181. cp "$OUTPUT_DIR"/"$SUBJECT_ID"/T1wDividedBy${RATIO_TYPE}.nii.gz $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-micro.nii.gz
  182. REGISTER_T1=1
  183. fi
  184. # -----------------------------
  185. # Check for Freesurfer output and/or run Fastsurfer
  186. # -----------------------------
  187. if [[ ! -f "$SUBJECTS_DIR"/"$SUBJECT_ID"/surf/lh.pial ]]; then
  188. echo "[WARNING] Freesurfer data not found at "$SUBJECTS_DIR"/"$SUBJECT_ID". Will try to run Fastsurfer"
  189. if [[ -z "$ANAT_DIR" ]]; then
  190. echo "[ERROR] Freesurfer output missing, and no --anat-dir provided to run Fastsurfer on."
  191. exit 1
  192. fi
  193. bash "$TOOLBOX_BIN/run_fastsurfer.sh" "$ANAT_DIR" "$SUBJECT_ID" "$SUBJECTS_DIR" "$OUTPUT_DIR"
  194. if [[ ! -n "$MICRO_IMAGE" ]]; then
  195. RESLICE_MICRO=1 # Defines whether reslicing of affine registration will be used for co-registration of micro-image. Dependent on surface generation from T1 in micro-image.
  196. fi
  197. else
  198. echo "[INFO] Found Freesurfer directory: "$SUBJECTS_DIR"/"$SUBJECT_ID""
  199. fi
  200. # -----------------------------
  201. # Generate intracortical surfaces
  202. # -----------------------------
  203. echo "[INFO] Creating intracortical surfaces"
  204. total_surfaces=$((NUM_SURFACES + 2))
  205. for hemi in lh rh ; do
  206. python3 ${TOOLBOX_BIN}/generate_equivolumetric_surfaces.py \
  207. ${SUBJECTS_DIR}/${SUBJECT_ID}/surf/${hemi}.pial \
  208. ${SUBJECTS_DIR}/${SUBJECT_ID}/surf/${hemi}.white \
  209. $total_surfaces \
  210. ${OUTPUT_DIR}/${SUBJECT_ID}/${hemi}. \
  211. /tmp/ \
  212. --software freesurfer --subject_id $SUBJECT_ID
  213. done
  214. rm -rfv ${OUTPUT_DIR}/${SUBJECT_ID}/*.0.0.pial ${OUTPUT_DIR}/${SUBJECT_ID}/*.1.0.pial # removing pial and wm surfaces
  215. # -----------------------------
  216. # Co-register microstructure image
  217. # -----------------------------
  218. if [[ "$RESLICE_MICRO" == 1 ]]; then
  219. echo "[INFO] Reslicing micro-image to surface space"
  220. mri_vol2vol --mov $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-micro.nii.gz \
  221. --targ ${SUBJECTS_DIR}/${SUBJECT_ID}/mri/rawavg.mgz \
  222. --regheader \
  223. --o "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_space-fsnative_desc-micro.nii.gz \
  224. --no-save-reg
  225. else
  226. if [[ "$REGISTER_T1" == 1 ]]; then
  227. echo "[INFO] Performing affine registration of T1 to surface space"
  228. # define image to use as template for transformation (micro volume to surface space)
  229. if [[ "$SKIP_BC" == 1 ]]; then
  230. cp $OUTPUT_DIR/$SUBJECT_ID/T1w.nii.gz $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-template.nii.gz
  231. else
  232. cp $OUTPUT_DIR/$SUBJECT_ID/T1w_BC.nii.gz $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-template.nii.gz
  233. fi
  234. else
  235. echo "[INFO] Performing affine registration of micro-image to surface space"
  236. cp ${MICRO_IMAGE} $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-template.nii.gz
  237. cp ${MICRO_IMAGE} $OUTPUT_DIR/$SUBJECT_ID/"$SUBJECT_ID"_space-native_desc-micro.nii.gz
  238. fi
  239. if [[ ! -f "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_space-fsnative_desc-micro.nii.gz ]] ; then
  240. singularity exec -B $SUBJECTS_DIR/:/subjects_dir \
  241. -B $OUTPUT_DIR/:/out_dir \
  242. -B $TOOLBOX_BIN/:/toolbox_bin \
  243. -B $FREESURFER_HOME/:/freesurfer \
  244. "${SING_IMG}" \
  245. /toolbox_bin/coregister_micro.sh "$SUBJECT_ID"
  246. fi
  247. fi
  248. # -----------------------------
  249. # Compute SNR of microstructure image
  250. # -----------------------------
  251. if [[ "$RUN_SNR" == 1 ]]; then
  252. echo "[INFO] Computing SNR along profiles"
  253. singularity exec -B $SUBJECTS_DIR/:/subjects_dir \
  254. -B $OUTPUT_DIR/:/out_dir \
  255. -B $TOOLBOX_BIN/:/toolbox_bin \
  256. "${SING_IMG}" \
  257. /toolbox_bin/compute_snr.sh "$SUBJECT_ID" 9
  258. fi
  259. # -----------------------------
  260. # Sample microstructure profiles
  261. # -----------------------------
  262. # create symbolic link to fsaverage
  263. if [[ "$SURF_OUT" == *"fsaverage"* ]] ; then
  264. ln -s $FREESURFER_HOME/subjects/$SURF_OUT $SUBJECTS_DIR
  265. fi
  266. if [[ "$SURF_OUT" == "fsLR32k" ]] ; then
  267. ln -s $FREESURFER_HOME/subjects/fsaverage $SUBJECTS_DIR
  268. fi
  269. for hemi in lh rh ; do
  270. [[ $hemi == lh ]] && HEMI=L || HEMI=R
  271. # find all intracortical surfaces, list by creation time, sample intensities and convert to fsaverage
  272. x=$(ls -t ${OUTPUT_DIR}/${SUBJECT_ID}/${hemi}.0.*)
  273. for n in $(seq 1 1 ${NUM_SURFACES}) ; do
  274. which_surf=$(sed -n "${n}p" <<< "$x")
  275. filename=${which_surf##*/}
  276. if [[ ! -f ${SUBJECTS_DIR}/${SUBJECT_ID}/surf/$filename ]] ; then
  277. cp $which_surf ${SUBJECTS_DIR}/${SUBJECT_ID}/surf/$filename
  278. fi
  279. shortname=${filename#*.}
  280. # sample microstructure along intracortical surface
  281. mri_vol2surf --mov "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_space-fsnative_desc-micro.nii.gz \
  282. --regheader ${SUBJECT_ID} \
  283. --hemi ${hemi} \
  284. --surf $shortname \
  285. --o "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_MP-${n}.mgh \
  286. --interp trilinear
  287. # transform to desired output space
  288. if [[ "$SURF_OUT" == *"fsaverage"* ]] ; then
  289. # transform to fsaverage
  290. mri_surf2surf --hemi ${hemi} \
  291. --srcsubject $SUBJECT_ID --srcsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_MP-${n}.mgh \
  292. --trgsubject $SURF_OUT --trgsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-${SURF_OUT}_MP-${n}.mgh
  293. fi
  294. if [[ "$SURF_OUT" == "fsLR32k" ]] ; then
  295. # transform to fsaverage
  296. mri_surf2surf --hemi ${hemi} \
  297. --srcsubject $SUBJECT_ID --srcsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_MP-${n}.mgh \
  298. --trgsubject fsaverage --trgsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsaverage_MP-${n}.shape.gii
  299. # transform to fsLR32k using wb_command
  300. singularity exec -B $OUTPUT_DIR:/out_dir \
  301. -B $SCRIPT_DIR/templates:/templates \
  302. "${SING_IMG}" \
  303. wb_command -metric-resample \
  304. /out_dir/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsaverage_MP-${n}.shape.gii \
  305. /templates/fsaverage_std_sphere.${HEMI}.164k_fsavg_${HEMI}.surf.gii \
  306. /templates/fs_LR-deformed_to-fsaverage.${HEMI}.sphere.32k_fs_LR.surf.gii \
  307. ADAP_BARY_AREA \
  308. /out_dir/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsLR32k_MP-${n}.shape.gii \
  309. -area-metrics \
  310. /templates/fsaverage.${HEMI}.midthickness_va_avg.164k_fsavg_${HEMI}.shape.gii \
  311. /templates/fs_LR.${HEMI}.midthickness_va_avg.32k_fs_LR.shape.gii
  312. fi
  313. if [[ "$RUN_SNR" == 1 ]]; then
  314. # sample SNR along intracortical surface
  315. mri_vol2surf --mov "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_space-fsnative_desc-micro_SNR.nii.gz \
  316. --regheader ${SUBJECT_ID} \
  317. --hemi ${hemi} \
  318. --surf $shortname \
  319. --o "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_SNR-${n}.mgh \
  320. --interp trilinear
  321. if [[ "$SURF_OUT" == *"fsaverage"* ]] ; then
  322. # transform to fsaverage
  323. mri_surf2surf --hemi ${hemi} \
  324. --srcsubject $SUBJECT_ID --srcsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_SNR-${n}.mgh \
  325. --trgsubject $SURF_OUT --trgsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-${SURF_OUT}_SNR-${n}.mgh
  326. fi
  327. if [[ "$SURF_OUT" == "fsLR32k" ]] ; then
  328. # transform to fsaverage
  329. mri_surf2surf --hemi ${hemi} \
  330. --srcsubject $SUBJECT_ID --srcsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsnative_SNR-${n}.mgh \
  331. --trgsubject fsaverage --trgsurfval "$OUTPUT_DIR"/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsaverage_SNR-${n}.mgh
  332. # transform to fsLR32k using wb_command
  333. singularity exec -B $OUTPUT_DIR:/out_dir \
  334. -B $SCRIPT_DIR/templates:/templates \
  335. "${SING_IMG}" \
  336. wb_command -metric-resample \
  337. /out_dir/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsaverage_SNR-${n}.shape.gii \
  338. /templates/fsaverage_std_sphere.${HEMI}.164k_fsavg_${HEMI}.surf.gii \
  339. /templates/fs_LR-deformed_to-fsaverage.${HEMI}.sphere.32k_fs_LR.surf.gii \
  340. ADAP_BARY_AREA \
  341. /out_dir/"$SUBJECT_ID"/"$SUBJECT_ID"_hemi-${HEMI}_surf-fsLR32k_SNW-${n}.shape.gii \
  342. -area-metrics \
  343. /templates/fsaverage.${HEMI}.midthickness_va_avg.164k_fsavg_${HEMI}.shape.gii \
  344. /templates/fs_LR.${HEMI}.midthickness_va_avg.32k_fs_LR.shape.gii
  345. fi
  346. fi
  347. done
  348. ((Nsteps++))
  349. done
  350. ##------------------------------------------------------------------------------#
  351. # Generate MPs for easy reading
  352. echo "[INFO] Collating microstructure profiles and computing moments for shape analysis"
  353. singularity exec -B $OUTPUT_DIR/:/out_dir \
  354. -B $TOOLBOX_BIN/:/toolbox_bin \
  355. "${SING_IMG}" \
  356. python3 /toolbox_bin/collate_MP.py --output_dir /out_dir/ --subject_id "$SUBJECT_ID" --num_surfaces "$NUM_SURFACES" --surface_output "$SURF_OUT"
  357. if [[ "$RUN_SNR" == 1 ]]; then
  358. singularity exec -B $OUTPUT_DIR/:/out_dir \
  359. -B $TOOLBOX_BIN/:/toolbox_bin \
  360. "${SING_IMG}" \
  361. python3 /toolbox_bin/collate_SNR.py --output_dir /out_dir/ --subject_id "$SUBJECT_ID" --num_surfaces "$NUM_SURFACES" --surface_output "$SURF_OUT"
  362. fi
  363. ##------------------------------------------------------------------------------#
  364. # Clean up tmp folder and drop datalad files
  365. if [[ "$CLEAN_UP" == 1 ]]; then
  366. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*.mgh
  367. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*.pial
  368. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*synthseg*
  369. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*Warped*
  370. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*.mat
  371. rm -rf "$OUTPUT_DIR"/"$SUBJECT_ID"/*tmp*.nii.gz
  372. fi
  373. echo "[INFO] Toolbox completed for subject $SUBJECT_ID."

microstructure_profiling.sh at commit 38d4148, under MIT · at the source

Overview

Authors: Casey Paquola1,2, Jessica Royer3,4, Thanos Tsigaras1,2, Donna Gift Cabalo3, Youngeun Hwang3, Felix Hoffstaedter1,2, Simon B Eickhoff1,2, Boris C Bernhardt3
ORCID iDs: Casey Paquola
  1. Institute for Neuroscience and Medicine (INM-7), Forschungszentrum Juelich, Juelich, Germany
  2. Institute for Systems Neuroscience, Heinrich Heine Universität Dusseldorf, Dusseldorf, Germany
  3. McConnell Brain Imaging Centre (BIC) and Centre for Excellence in Epilepsy at the Neuro (CEEN), Montreal Neurological Institute, McGill University, Montreal, Canada
  4. Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, Germany
Journal: Imaging neuroscience (Cambridge, Mass.), volume 4, article IMAG.a.1212
Dates: received 16 October 2025; accepted 23 March 2026; published online 21 April 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/imag.a.1212 · PMID 42027740 · PMCID PMC13100671 · OpenAlex W7143464860
Open access: diamond, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), histology / microscopy (modality), methods / tools (subfield)
Keywords: quantitative MRI, cytoarchitecture, myeloarchitecture, in vivo histology, surface-based analysis, open-source pipeline
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: SickKids Foundation (NI17-039); National Science and Engineering Research Council of Canada (NSERC RGPIN-2025-05932); Healthy Brains and Healthy Lives; Brain Canada Foundation; CIHR (PJT-203761, PJT-191853, PJT-174995, FDN-154298); FRQS, the Tier-2 Canada Research Chairs Program; HIBALL; Deutsche Forschungsgemeinschaft (524408221); Centre for Excellence in Epilepsy at the Neuro
Citations: not cited yet (Europe PMC); 60 references in the paper

Abstract

Intracortical microstructure profiling represents a powerful, scalable approach for investigating the laminar organisation of the human cortex on both in-vivo and post-mortem datasets. Building upon a long tradition of histological analysis, this method leverages surface-based intracortical sampling to generate profiles of tissue properties across cortical depths. The present work outlines a standardised workflow for intracortical microstructural profiling, newly packaged as the open-source toolbox “CortPro” (https://github.com/caseypaquola/cortpro). Here, we explore the utility of central moments as descriptors of profile shape. Using these measures, we quantify (i) the extent to which in-vivo MRI can capture laminar differentiation, (ii) the test-retest reliability of profiles, and (iii) their replicability across sites and studies. Our results demonstrate that intracortical profiles are remarkably robust and effectively mitigate bias-field related limitations of non-quantitative MRI. As applications of microstructure-sensitive imaging expand across development, aging, and disease, microstructure profiling provides a principled means of linking microstructural neuroanatomy with systems-level brain organisation.

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

caseypaquola/CortPro

License: MIT
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 38d4148ec04bc4fab48cdf9fc1e3ec86324e0b66, 6 August 2026
Languages: Python (9), Shell (8), Jupyter (1)
Size: 60 files, 18 scripts
Software Heritage: not archived
Found in: “Data and Code Availability”
Holds: README, license file, environment (Dockerfile, Singularity.def, docs/requirements.txt), continuous integration, documentation
Not found: CITATION.cff, tests
Tools: FreeSurfer (7 files), NumPy (5 files), NiBabel (4 files), FSL (3 files), pandas (2 files), ANTs (1 file), neuromaps (1 file), SciPy (1 file), Connectome Workbench (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
20 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 18 scripts, each with its path and the digest of its content;
  • 8 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

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

Data

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

Data and Code Availability

Raw data for our analyses are available via the following open datasets:

Lüsebrink: https://open-science.ub.ovgu.de/items/5d8e3df2-f60f-44a9-b2c7-710fc1a142a0/full

Shams: https://data.donders.ru.nl/collections/di/dccn/DSC_3015046.03_479?26

MICA-MICs: https://osf.io/j532r/

MICA-PNI: https://osf.io/mhq3f/

ABCD: https://www.nbdc-datahub.org/

Preprocessed microstructure profiles are additionally available on the Microstructure Marketplace (https://osf.io/e6f7d/overview). Code used to conduct the analyses are available as part of CortPro (https://github.com/caseypaquola/CortPro).

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

Recorded: type, language, journal, volume, pages, dates, 8 authors, 6 keywords, 9 funders, 59 references.

Cite

This paper

Paquola, C., Royer, J., Tsigaras, T., Cabalo, D. G., Hwang, Y., Hoffstaedter, F., Eickhoff, S. B., & Bernhardt, B. C. (2026). Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1212. https://doi.org/10.1162/imag.a.1212

BibTeX

@article{paquola2026intracortical,
author = {Paquola, Casey and Royer, Jessica and Tsigaras, Thanos and Cabalo, Donna Gift and Hwang, Youngeun and Hoffstaedter, Felix and Eickhoff, Simon B and Bernhardt, Boris C},
title = {{Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = apr,
volume = {4},
pages = {IMAG.a.1212},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1212},
url = {https://doi.org/10.1162/imag.a.1212},
pmid = {42027740},
pmcid = {PMC13100671}
}

RIS

TY - JOUR
AU - Paquola, Casey
AU - Royer, Jessica
AU - Tsigaras, Thanos
AU - Cabalo, Donna Gift
AU - Hwang, Youngeun
AU - Hoffstaedter, Felix
AU - Eickhoff, Simon B
AU - Bernhardt, Boris C
TI - Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/04/21
VL - 4
SP - IMAG.a.1212
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1212
UR - https://doi.org/10.1162/imag.a.1212
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1212",
"type": "article-journal",
"title": "Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Paquola",
"given": "Casey"
},
{
"family": "Royer",
"given": "Jessica"
},
{
"family": "Tsigaras",
"given": "Thanos"
},
{
"family": "Cabalo",
"given": "Donna Gift"
},
{
"family": "Hwang",
"given": "Youngeun"
},
{
"family": "Hoffstaedter",
"given": "Felix"
},
{
"family": "Eickhoff",
"given": "Simon B"
},
{
"family": "Bernhardt",
"given": "Boris C"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "4",
"page": "IMAG.a.1212",
"DOI": "10.1162/imag.a.1212",
"PMID": "42027740",
"PMCID": "PMC13100671",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1212",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
21
]
]
}
}

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.1162/imag.a.1279 [code]
Multimodal laminar characterization of visual areas along the cortical hierarchy.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: ANTs, FSL, NiBabel, 3 other tools, histology / microscopy, 7 references
[2] 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 communications
In common: neuromaps, ANTs, FreeSurfer, 4 other tools, structural MRI / diffusion, 6 references
[3] doi:10.1371/journal.pbio.3003856 [code]
Aging and metabolism contribute separately to brain-body health.
Journal: PLoS biology
In common: neuromaps, Connectome Workbench, ANTs, 6 other tools, structural MRI / diffusion, 3 references
[4] doi:10.1038/s41467-026-72940-5 [code]
Cerebellar growth is associated with domain-specific cerebral maturation and socio-linguistic behavior.
Journal: Nature communications
In common: neuromaps, Connectome Workbench, FSL, 4 other tools, author Casey Paquola
[5] doi:10.1038/s42003-026-10276-y [code]
The cellular correlates and adolescent reorganisation of cortical myelination networks in the common marmoset.
Journal: Communications biology
In common: FreeSurfer, NiBabel, pandas, 2 other tools, structural MRI / diffusion, 6 references
[6] doi:10.1038/s41398-026-04025-2 [code]
Brain energetic landscapes shape state dysregulation in major depressive disorder: a morphological network controllability perspective.
Journal: Translational psychiatry
In common: neuromaps, Connectome Workbench, ANTs, 6 other tools, 1 reference
[7] doi:10.21203/rs.3.rs-9326213/v1 [code]
Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brain
Journal: Research Square (preprint)
In common: neuromaps, Connectome Workbench, ANTs, 6 other tools, 1 reference
[8] doi:10.1016/j.neuron.2026.04.011 [code]
Precision fMRI reveals densely interdigitated network patches with conserved motifs in the lateral prefrontal cortex.
Journal: Neuron
In common: Connectome Workbench, ANTs, FreeSurfer, 4 other tools, 3 references
[9] doi:10.1038/s41467-026-71270-w [code]
Spatiotemporal dynamics of the human cortical functional hierarchy across the lifespan.
Journal: Nature communications
In common: Connectome Workbench, FreeSurfer, FSL, 4 other tools, 3 references
[10] doi:10.7554/elife.108408 [code]
Frequency and laminar profile of feature-specific visual activity revealed by interleaved EEG-fMRI.
Journal: eLife
In common: Connectome Workbench, ANTs, FreeSurfer, 5 other tools, 2 references

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.