structural
tit.pre.structural ¶
Preprocessing pipeline orchestration.
This module contains the top-level run_pipeline function that drives
all preprocessing steps for one or more subjects, including DICOM
conversion, FreeSurfer recon-all, SimNIBS CHARM, tissue analysis, DWI
preprocessing (QSIPrep/QSIRecon), DTI tensor extraction, and subcortical
segmentation.
Public API¶
run_pipeline Run the full preprocessing pipeline for one or more subjects.
See Also¶
tit.pre : Package-level overview and convenience re-exports.
run_pipeline ¶
run_pipeline(subject_ids: Iterable[str], *, convert_dicom: bool = False, run_recon: bool = False, parallel_recon: bool = False, parallel_cores: int | None = None, create_m2m: bool = False, run_tissue_analysis: bool = False, run_qsiprep: bool = False, run_qsirecon: bool = False, qsiprep_config: dict | None = None, qsi_recon_config: dict | None = None, extract_dti: bool = False, run_subcortical_segmentations: bool = False, skip_existing_outputs: bool = False, replace_existing_outputs: bool = False, stop_event: object | None = None, logger_callback: Callable | None = None, runner: CommandRunner | None = None) -> int
Run the preprocessing pipeline for one or more subjects.
Orchestrates DICOM conversion, FreeSurfer recon-all, SimNIBS CHARM, tissue analysis, QSIPrep/QSIRecon DWI preprocessing, DTI tensor extraction, and subcortical segmentation. Steps are enabled via boolean flags; disabled steps are skipped.
Parameters¶
subject_ids : iterable of str
Subject identifiers without the sub- prefix.
convert_dicom : bool, optional
Run DICOM-to-NIfTI conversion.
run_recon : bool, optional
Run FreeSurfer recon-all.
parallel_recon : bool, optional
Run recon-all in parallel across subjects.
parallel_cores : int or None, optional
Maximum number of parallel subjects for recon-all.
create_m2m : bool, optional
Run SimNIBS charm (also runs subject_atlas for .annot
files).
run_tissue_analysis : bool, optional
Run tissue-volume and thickness analysis.
run_qsiprep : bool, optional
Run QSIPrep DWI preprocessing via Docker.
run_qsirecon : bool, optional
Run QSIRecon reconstruction via Docker.
qsiprep_config : dict or None, optional
Extra configuration passed to run_qsiprep.
qsi_recon_config : dict or None, optional
Extra configuration passed to run_qsirecon.
extract_dti : bool, optional
Extract DTI tensor for SimNIBS anisotropic conductivity.
run_subcortical_segmentations : bool, optional
Run thalamic-nuclei and hippocampal-subfield segmentations.
skip_existing_outputs : bool, optional
Skip selected preprocessing steps when their output already exists.
replace_existing_outputs : bool, optional
Remove selected existing outputs before rerunning their steps.
stop_event : object or None, optional
Threading event used to cancel running steps.
logger_callback : callable or None, optional
Callback used by the GUI to capture log lines.
runner : CommandRunner or None, optional
Subprocess runner used to stream command output.
Returns¶
int
0 on success, 1 on failure.
Raises¶
PreprocessError If no subjects are provided or a preprocessing step fails. PreprocessCancelled If stop_event is set during execution.
See Also¶
run_dicom_to_nifti : DICOM-to-NIfTI conversion step. run_recon_all : FreeSurfer recon-all step. run_charm : SimNIBS CHARM head-mesh step. run_tissue_analysis : Tissue analysis step. run_qsiprep : QSIPrep DWI preprocessing step. run_qsirecon : QSIRecon reconstruction step. extract_dti_tensor : DTI tensor extraction step.
Source code in tit/pre/structural.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | |