I want to give names to call and concatenate the process data later.
from glob import glob
import nibabel as nib
import numpy as np
emot= glob('path/emotion_***.nii')
em_1 = nib.load(emot[0]).get_data()
em_2 = nib.load(emot[1]).get_data()
em_1 = np.reshape(em_1[:,36], (90,104))
em_2 = np.reshape(em_2[:,36], (90,104))
data_emot = np.concatenate([em_1,em_2])
How could I do it the faster way with more than 100 elements in the glob list?
Additional info, the nib.load()
and .get_data()
are the nibabel process. Thus, if they load together with numpy reshape, str is called, rather the loaded process.