compute_global_signal

bidsaid.qc.compute_global_signal(func_file_or_img, mask_img_or_file=None)[source]

Compute global signal and percent signal change from functional NIfTI image.

Parameters

func_file_or_imgstr, Path, or Nifti1Image

Path to the functional NIfTI file or a functional NIfTI image.

mask_img_or_filestr, Path, Nifti1Image, or None, default=None

Path to the mask NIfTI file or a mask NIfTI image. If None, a mask is computed automatically.

Returns

dict[str, np.ndarray]

A dictionary with the following keys:

  • “global_signal”: Raw global signal time series.

  • “global_signal_percent_change”: Percent signal change time series.