You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem - ciftify_falff has a TR and 2.0s hard coded into script (we missed this because it was tested on a dataset with a TR of 2.0s. The script needs to be adapted to read teh TR from the file (or a -flag that can specify the TR is this is wrong. Then incorporates the TR into the calculation following the code below
defcalculate_falff(timeseries, min_low_freq=0.01, max_low_freq=0.08, min_total_freq=0.00, calc_alff=False, TR=2):
''' this will calculate falff from a timeseries'''n=len(timeseries)\n",
time= (np.arange(n))*2# Takes fast Fourier transform of timeseriesfft_timeseries=fft(timeseries)
# Calculates frequency scalefreq_scale=np.fft.fftfreq(n, TR/1)
# Calculates power of fftmag= (abs(fft_timeseries))**0.5# Define max_total_freqmax_total_freq= (1/TR)/2# Finds low frequency range (0.01-0.08) and total frequency range (0.0-0.25)low_ind=np.where((float(min_low_freq) <=freq_scale) & (freq_scale<=float(max_low_freq)))
total_ind=np.where((float(min_total_freq) <=freq_scale) & (freq_scale<=float(max_total_freq)))
# Indexes power to low frequency index, total frequency range\n",low_power=mag[low_ind]\n",
total_power=mag[total_ind]\n",
# Calculates sum of lower power and total powerlow_pow_sum=np.sum(low_power)
total_pow_sum=np.sum(total_power)
# Calculates alff as the sum of amplitudes within the low frequency rangeifcalc_alff:\n",
calc=low_pow_sum\n",
# Calculates falff as the sum of power in low frequnecy range divided by sum of power in the total frequency rangeelse:
calc=np.divide(low_pow_sum, total_pow_sum)
returncalc
The text was updated successfully, but these errors were encountered:
The problem - ciftify_falff has a TR and 2.0s hard coded into script (we missed this because it was tested on a dataset with a TR of 2.0s. The script needs to be adapted to read teh TR from the file (or a -flag that can specify the TR is this is wrong. Then incorporates the TR into the calculation following the code below
The text was updated successfully, but these errors were encountered: