charm
tit.pre.charm ¶
SimNIBS CHARM head-mesh creation and subject atlas segmentation.
Wraps the SimNIBS charm command to generate m2m head-mesh directories
and the subject_atlas command to create cortical parcellation
.annot files for a2009s, DK40, and HCP_MMP1 atlases.
Public API¶
run_charm
Run SimNIBS charm for a subject.
run_subject_atlas
Create atlas .annot files from an existing m2m directory.
See Also¶
tit.pre.recon_all : FreeSurfer recon-all cortical reconstruction.
tit.pre.structural.run_pipeline : Full preprocessing pipeline.
run_charm ¶
run_charm(project_dir: str, subject_id: str, *, logger, runner: CommandRunner | None = None) -> None
Run SimNIBS charm to generate a head mesh for a subject.
Creates an m2m directory at the standard BIDS derivatives location containing the volumetric head model required for TI simulations.
Parameters¶
project_dir : str
BIDS project root.
subject_id : str
Subject identifier without the sub- prefix.
logger : logging.Logger
Logger used for progress and command output.
runner : CommandRunner or None, optional
Subprocess runner used to stream output.
Raises¶
PreprocessError
If no T1 image is found, the m2m directory already exists, or
charm exits with a non-zero code.
See Also¶
run_subject_atlas : Create atlas .annot files after CHARM.
run_recon_all : FreeSurfer cortical reconstruction.
Source code in tit/pre/charm.py
run_subject_atlas ¶
run_subject_atlas(project_dir: str, subject_id: str, *, logger, runner: CommandRunner | None = None) -> None
Run subject_atlas to create .annot files for a subject.
Should be called after run_charm completes successfully.
Generates all three atlases: a2009s, DK40, and HCP_MMP1.
Parameters¶
project_dir : str
BIDS project root.
subject_id : str
Subject identifier without the sub- prefix.
logger : logging.Logger
Logger used for progress and command output.
runner : CommandRunner or None, optional
Subprocess runner used to stream output.
Raises¶
PreprocessError
If the m2m directory does not exist or subject_atlas fails.
See Also¶
run_charm : Generate the m2m head mesh (prerequisite).