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).
Screenshot staged for demonstration: placeholder paths, a simulated run, and the environment strip shown as ready.
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
Prepare the input
T1w NIfTI → FSL BET, FAST, affine MNI registration, GM threshold and mask → masked GM map.
Reconstruct both directions
The packaged bilateral DGN performs left-to-right and right-to-left inference on the same preprocessed gray-matter grid.
Compute ANS and RNS
Voxel-wise comparison yields ANS and RNS; both directions merge into bilateral target-hemisphere maps.
Summarize or validate
Optionally aggregate with a compatible atlas, run hemisphere-classifier validation, or estimate test–retest reliability.
Asymmetry metrics
absolute neuroanatomical specificity
|Acti − Reconi|
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
| Stage | Input | Main operation | Output |
|---|---|---|---|
| Preprocessing | T1-weighted NIfTI | FSL brain extraction, tissue segmentation, affine MNI registration, GM threshold/mask | *_GM_masked.nii.gz |
| Reconstruction | Preprocessed GM map | Left-to-right and right-to-left DGN inference | Reconstructed target hemispheres |
| Metric computation | Actual and reconstructed GM | ANS/RNS residual metrics | ANS.L, ANS.R, RNS.L, RNS.R maps |
| Optional summaries | Voxel maps + compatible atlas | ROI aggregation | Long and wide ROI tables |
| Optional validation | Maps/ROI features | Hemisphere classification and/or TRT analysis | Validation 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
Quick start
Install the source checkout, inspect model readiness, and run the GUI or bilateral CLI.
Methods
Read the reconstruction framework, metric definitions, and implementation details.
Data and models
Learn how DGN checkpoints, classifier bundles, and optional ROI atlases are resolved.
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.