mrsiprep.workflows.participant
Participant workflow orchestration.
Functions
|
Resolve the (subject, session) recordings a run should process. |
|
Run the full mrsiprep pipeline for every recording matched by |
|
Dry-run input validation for every recording matched by |
Classes
|
Outcome of processing (or validating) one subject/session recording. |
- class mrsiprep.workflows.participant.RecordingStatus(subject, session, status, outputs=<factory>, error=None)[source]
Bases:
objectOutcome of processing (or validating) one subject/session recording.
- Variables:
subject -- BIDS subject label, without the
sub-prefix.session -- BIDS session label without the
ses-prefix, orNonefor session-less datasets.status -- One of
"skipped"(failed validation before processing started),"success", or"failed"(raised during Nipype execution).outputs -- Output paths produced for this recording, keyed by a short name (e.g.
"t1w","qc_summary","regional_table"); empty for skipped recordings.error -- Human-readable error message, set when
statusis"skipped"or"failed".
- Parameters:
subject (str)
session (str | None)
status (str)
outputs (dict)
error (str | None)
- error: str | None = None
- outputs: dict
- session: str | None
- status: str
- subject: str
- mrsiprep.workflows.participant.collect_recordings(config)[source]
Resolve the (subject, session) recordings a run should process.
Resolution order: an explicit
--participants-file(onesub[,ses]pair per line) takes precedence; otherwise--participant-label/--session-labelare combined pairwise; otherwise every recording is discovered by scanningconfig.bids_dir.- Parameters:
config -- Run-wide
mrsiprep.config.settings.MRSIPrepConfig.- Returns:
List of
mrsiprep.io.bids.Recording, not yet validated -- validity is checked later, per-recording, byrun_participant_workflow()/validate_participant_inputs().- Return type:
list[Recording]
- mrsiprep.workflows.participant.run_participant_workflow(config)[source]
Run the full mrsiprep pipeline for every recording matched by
config.This is the top-level entry point called by the CLI (
mrsiprep.cli.run) forparticipant-level runs. Steps:Ensure work/derivative directories exist.
Resolve recordings via
collect_recordings()and validate each one's inputs; failures are recorded as"skipped"and excluded from processing (other recordings still run).If
config.longitudinal, build one subject-level T1w template per subject with 2+ ready sessions, used to seed each session's T1w→MNI registration.Dispatch all ready recordings to the Nipype execution engine (
mrsiprep.workflows.nipype_engine.run.execute_recordings_nipype()), which runs each recording's per-step cached workflow and reports"success"/"failed"per recording.
- Parameters:
config -- Run-wide
mrsiprep.config.settings.MRSIPrepConfig.- Returns:
One
RecordingStatusper recording matched byconfig(empty list if none matched).- Return type:
list[RecordingStatus]
- mrsiprep.workflows.participant.validate_participant_inputs(config)[source]
Dry-run input validation for every recording matched by
config.Same discovery/validation logic as
run_participant_workflow()(including the same preflight input-availability table) but never builds subject templates or dispatches to Nipype -- used by--validate-onlyto report which recordings are ready without running the pipeline.- Parameters:
config -- Run-wide
mrsiprep.config.settings.MRSIPrepConfig.- Returns:
One
RecordingStatusper recording matched byconfig, withstatuseither"failed"(validation failed;outputsempty) or"success"(validation passed;outputspopulated with keys"t1w","metabolites","snr","linewidth","brainmask"-- nothing is actually processed).- Return type:
list[RecordingStatus]