Dear AFNI expert,
I am using the following command to bandpass filter my fMRI data
3dBandpass -prefix filtered_func_data_clean_bandpassed.nii.gz -nodetrend 0.010000 0.120000 filtered_func_data_new.nii.gz
However, I notice that if I extract the FC matrix after 3dBandpass the eigenvalues are negative which should not be the case with Pearson Correlation. I’ve seen that this indeed doesn’t happen if I skip the bandpass filter in my pipeline.
Of course, it is related with something that 3dBandpass is doing in the background
Would you mind provide me an insight why that?
I’m a little curious how you calculate your FC matrix—do you have a set of N ROIs, and then calculate the Pearson correlation among them (e.g., with 3dNetCorr), which produces an NxN matrix, and then calculate eigenvalues/vectors of that (and what tool do you use for that)?
The correlation matrix is NxN and symmetric, so its N eigenvalues should be real. The diagonals of a standard Pearson Correlation are all 1, and I think the sum of the matrix’s eigenvalues will be N. However, I don’t believe there is any restriction that the eigenvalues need to be positive definite (>0) or positive-semidefinite (>=0)—that will depend on the actual values comprising the matrix.
When you bandpass time series, you do change the ROI correlations—it is possible for correlations to change sign, and I don’t see why the eigenvalues couldn’t change sign (again, though, I believe their sum will still be N).
thanks for your reply.
I’ve computed FC both using 3dNetCorr and Nilearn (in python). I am using a brain parcellation that it is already registered to fMRI space. 3dNetCorr and Nilearn produced the same FC matrix. Moreover If I skip the 3dBandpass step on my pipeline and bandpass the filter in nilearn the eigenvalue turned out to be positive. That’s why it was related to only 3dBandpass command. Not sure what is going on here because as you said bandpass time series should not change the eigenvalues sign (as in the case where I bandpass the data using nilearn)
Glad that the two softwares agree on the correlation values.
Please note that I wrote that bandpassing does typically lead to different correlation values, and this will typically change the eigenvalues. Indeed, I don’t think there is any theoretical reason that the correlation matrix would have to have only positive eigenvalues—that might just be how your matrix happened to appear with that particular data.
What is your bandpass command for nilearn, and what is it for 3dBandpass? Bandpassing should produce the same results between the two different softwares. There might be some other processing occuring at the same time in either/both programs, such as demeaning or regressing out linear trends. For example, 3dBandpass will do some detrending by default, which you can turn off:
-nodetrend = Skip the quadratic detrending of the input that
occurs before the FFT-based bandpassing.
++ You would only want to do this if the dataset
had been detrended already in some other program.
It would be good to track down those differences.