mrsiprep.workflows.registration

Registration workflow.

Functions

run_registration_workflow(config, subject, ...)

Register one recording's MRSI reference to T1w, and T1w to MNI if requested.

Classes

RegistrationResult(mrsi_to_t1, t1_to_mni)

Forward/inverse transforms produced by run_registration_workflow().

class mrsiprep.workflows.registration.RegistrationResult(mrsi_to_t1, t1_to_mni)[source]

Bases: object

Forward/inverse transforms produced by run_registration_workflow().

Parameters:
mrsi_to_t1: MRSIToT1Result
t1_to_mni: T1ToMNIResult | None
mrsiprep.workflows.registration.run_registration_workflow(config, subject, session, mrsi_reference, registration_t1, registration_mask=None, mrsi_mask=None, subject_template=None)[source]

Register one recording's MRSI reference to T1w, and T1w to MNI if requested.

MRSI→T1w always runs, via mrsiprep.registration.mrsi_to_t1.run_mrsi_to_t1() (or the MIDAS-faithful rigid+mutual-information variant, run_mrsi_to_t1_rigid_mi(), when config.processing_mode == "midas"). T1w→MNI only runs when MNI output space, MNI parcellation, or an MNI transform is actually requested by config.

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

  • subject (str) -- BIDS subject label, without the sub- prefix.

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

  • mrsi_reference (Path) -- Reference-metabolite image driving MRSI→T1w registration.

  • registration_t1 (Path) -- T1w image to register to (see mrsiprep.workflows.anatomical.prepare_anatomical()'s registration_t1w).

  • registration_mask (Path | None) -- T1w-side fixed mask for registration, if any.

  • mrsi_mask (Path | None) -- MRSI-native brainmask; only used by the fsl backend's FNIRT stage, as the moving-side mask FNIRT needs alongside registration_mask.

  • subject_template -- Optional precomputed SubjectTemplateResult, built once per subject when --longitudinal is on and the subject has 2+ sessions. When present, T1w-to-MNI is composed via (session→template)+(template→MNI) instead of registering this session directly to MNI.

Returns:

RegistrationResult with the MRSI→T1w transforms always set, and T1w→MNI transforms set only when that stage ran.

Return type:

RegistrationResult