Hemisphere-specific neuroimaging toolkit

HemiSpec

by 阿瞒的脑洞 · A MAN'S BRAINHOLE

HemiSpec is a research-software toolkit for converting preprocessed gray-matter maps into bilateral reconstruction-derived hemispheric measures: ANS (absolute neuroanatomical specificity) and RNS (relative neuroanatomical specificity).

Quick startInput & preprocessingInstallation →

HemiSpec — ANS/RNS Generation Workbench
HemiSpec desktop workbench: configuration on the left; run status, flow diagram and log on the right HemiSpec desktop workbench: configuration on the left; run status, flow diagram and log on the right

Screenshot staged for demonstration: placeholder paths, a simulated run, and the environment strip shown as ready.

Input boundary

HemiSpec does not accept raw T1-weighted MRI directly as DGN input. First convert each T1 image into an MNI152 1.5 mm masked gray-matter map (*_GM_masked.nii.gz) using the documented FSL preprocessing workflow.

End-to-end workflow

01

Prepare the input

T1w NIfTI → FSL BET, FAST, affine MNI registration, GM threshold and mask → masked GM map.

02

Reconstruct both directions

The packaged bilateral DGN performs left-to-right and right-to-left inference on the same preprocessed gray-matter grid.

03

Compute ANS and RNS

Voxel-wise comparison yields ANS and RNS; both directions merge into bilateral target-hemisphere maps.

04

Summarize or validate

Optionally aggregate with a compatible atlas, run hemisphere-classifier validation, or estimate test–retest reliability.

Asymmetry metrics

ANS

absolute neuroanatomical specificity

|Acti − Reconi|

RNS

relative neuroanatomical specificity

|(Acti − Reconi) / (Acti + Reconi)|

Wang et al. 2024, Patterns 5:100930

ANS and RNS are non-negative reconstruction-error-derived quantities, not distances in millimetres, and not direct measurements of neuronal function, causal lateralization, or tissue pathology. The published definitions come from Wang et al. (2024); see ANS and RNS metrics for the exact software interpretation.

The method at a glance

Graphical abstract of Wang et al. (2024): cross-hemispheric reconstruction with a context encoder and ANS/RNS maps
Graphical abstract of the cross-hemispheric reconstruction framework. Reproduced without changes from Wang, G. et al. (2024), “Using a deep generation network reveals neuroanatomical specificity in hemispheres,” Patterns 5(4):100930, doi:10.1016/j.patter.2024.100930, under CC BY 4.0.
Cross-hemispheric reconstruction and ANS/RNS definitions
Figure: Ma, Q. et al., “Reconstruction-derived hemispheric specificity captures distributed structural information related to handedness” (manuscript in preparation). Conceptual reconstruction framework and ANS/RNS definitions from Wang et al. (2024). HemiSpec starts from FSL-preprocessed GM maps. ANS/RNS are non-negative GM-derived measures, not distances in millimetres.
StageInputMain operationOutput
PreprocessingT1-weighted NIfTIFSL brain extraction, tissue segmentation, affine MNI registration, GM threshold/mask*_GM_masked.nii.gz
ReconstructionPreprocessed GM mapLeft-to-right and right-to-left DGN inferenceReconstructed target hemispheres
Metric computationActual and reconstructed GMANS/RNS residual metricsANS.L, ANS.R, RNS.L, RNS.R maps
Optional summariesVoxel maps + compatible atlasROI aggregationLong and wide ROI tables
Optional validationMaps/ROI featuresHemisphere classification and/or TRT analysisValidation tables and plots

Original method vs HemiSpec additions

Original method (Wang et al. 2024)

  • Cross-hemispheric DGN reconstruction framework
  • ANS and RNS definitions
  • Published scientific evidence and terminology

Added by HemiSpec

  • Installable API, CLI, and GUI workflow
  • Model-asset discovery and bilateral map export
  • ROI summaries, validation utilities, documentation, and release tooling

Choose your path

How to cite

If you use HemiSpec, cite the original framework and record the software release.

Wang, G., Jiang, N., Ma, Y., Suo, D., Liu, T., Funahashi, S., & Yan, T. (2024). Using a deep generation network reveals neuroanatomical specificity in hemispheres. Patterns, 5(4), 100930.

Paper DOI: 10.1016/j.patter.2024.100930 · Zenodo record: 10.5281/zenodo.10466961

For software and downstream citations, see Citation.

Current scope

Supported now

  • Voxel-wise ANS and RNS maps
  • Optional ROI tables when an atlas on the input grid is available
  • Optional hemisphere-classifier validation with the compatible Glasser atlas and labels
  • Optional test–retest reliability
  • Source checkout installation; the PyPI project is not public yet

Not in scope

  • Raw T1-weighted images as direct DGN input
  • Behavioral-phenotype modeling as a built-in command
  • Anatomical interpretation of synthetic quickstart outputs
  • Unpublished study results

Source of truth. This site documents the current main checkout. The archived v0.1.0 release predates some commands shown here.

Runs. Use a new or empty output directory for each run. The GUI warns when the output folder is not empty and lets you continue or cancel; continuing may overwrite existing files. In the CLI, hemispec quickstart refuses a non-empty --out-dir unless you pass --force, which deletes and regenerates that directory; hemispec workflow and the single-step commands do not check, so choose a fresh folder yourself.

HemiSpec · by 阿瞒的脑洞 · A MAN'S BRAINHOLE · Source: github.com/mqqq333/HemiSpec · Documentation built with Material for MkDocs.