mrsiprep.workflows.parcellation

Parcellation workflow.

Functions

run_parcellation_workflow(config, subject, ...)

Dispatch to the configured parcellation backend and project atlas labels into MRSI-native space.

mrsiprep.workflows.parcellation.run_parcellation_workflow(config, subject, session, mrsi_reference, registration_result, raw_t1=None, t1_reference=None)[source]

Dispatch to the configured parcellation backend and project atlas labels into MRSI-native space.

Backend is selected via config.parcellation_mode:

  • "synthseg" -- SynthSeg cortical/subcortical labels, projected via the inverse MRSI→T1w transform (registration_result.mrsi_to_t1.inverse). Requires raw_t1.

  • "chimera" -- Chimera multi-atlas fusion, same inverse-transform projection.

  • "mni" -- the bundled MNI-space atlas, projected via both the inverse T1w→MNI and inverse MRSI→T1w transforms. Requires registration_result.t1_to_mni to be set (i.e. MNI normalization ran) and a t1_reference image.

Parameters:
  • config -- Run-wide mrsiprep.config.settings.MRSIPrepConfig.

  • subject -- BIDS subject label, without the sub- prefix.

  • session -- BIDS session label without the ses- prefix, or None for session-less datasets.

  • mrsi_reference -- Reference-metabolite image defining the target MRSI grid.

  • registration_result -- mrsiprep.workflows.registration.RegistrationResult for this recording, supplying the inverse transforms used to project atlas labels into MRSI space.

  • raw_t1 -- Non-skull-stripped T1w, required for "synthseg".

  • t1_reference -- T1w-space reference image, required for "mni".

Returns:

Backend-specific parcellation result object (see mrsiprep.parcellation.synthseg, mrsiprep.parcellation.chimera_native, or mrsiprep.parcellation.mni_atlas).

Raises:
  • FileNotFoundError -- If "synthseg" is selected without raw_t1.

  • RuntimeError -- If "mni" is selected but T1w-to-MNI normalization wasn't run.

  • ValueError -- If "mni" is selected without t1_reference, or config.parcellation_mode isn't a supported value.