tedana.io.load_data_nilearn

load_data_nilearn(data, mask_img, n_echos, dtype=<class 'numpy.float32'>)[source]

Load multi-echo data as a masked array.

Parameters:
  • data (list of str) – List of paths to input files. May only have one element for z-concatenated data.

  • mask_img (nibabel image) – Mask image to apply

  • n_echos (int) – Number of echoes in the data

  • dtype (numpy dtype, optional) – Dtype to load data as. Default is float32 for speed and memory.

Returns:

data_cat ((Mb x E x T) array) – Masked multi-echo data where Mb is samples in base mask, E is echoes, T is time

Notes

This function prefers a fast path using direct boolean indexing into the image data (avoiding nilearn’s check_niimg overhead). If that fails for any reason, it falls back to nilearn’s masking.apply_mask.