I’m trying to extract timeseries for ROIs defined by Talairach atlas from nilearn.
I define a masker object
talairach = datasets.fetch_atlas_talairach('ba') talairach_filename = talairach.maps talairach_masker = NiftiLabelsMasker(labels_img=talairach_filename, standardize=True, resampling_target = 'data', memory='nilearn_cache', verbose=5)
Then extract timeseries using fit_transform
timeseries = talairach_masker.fit_transform(denoised_data_path, confounds=None)
The resulting variable timeseries has shape (n_scans, n_rois). In my case (187, 69).
len(talairach.labels) is 72, with the first label being background. So timeseries should be (187, 71)
If I specify
resampling_target = 'lables', it seems to work correctly, and the output is (187, 71).
I tried the same with Harvard-Oxford atlas. And there it doesn’t matter how I specify the resampling_taget, the output always has the correct shape.
Does anybody know why it behaves differently?