-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNM: Add fALFF, PerAF, and tSNR outputs #1030
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1030 +/- ##
==========================================
+ Coverage 82.33% 82.43% +0.10%
==========================================
Files 48 48
Lines 5897 5949 +52
Branches 796 802 +6
==========================================
+ Hits 4855 4904 +49
Misses 839 839
- Partials 203 206 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I'd be sure to add is a check for nan/inf values in percent alff
write_ndata( | ||
mean_bold, | ||
template=self.inputs.preprocessed_bold, | ||
filename=self._results["mean_bold"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does self._results
get created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's created automatically by the class, I believe. I define self._results["mean_bold"]
in the line before this I think (344).
xcp_d/utils/restingstate.py
Outdated
# Lomb-Scargle periodogram will have the same scale. | ||
voxel_data_censored -= np.mean(voxel_data_censored) | ||
voxel_data_censored /= np.std(voxel_data_censored) | ||
|
||
time_arr = np.arange(0, n_volumes * TR, TR) | ||
assert sample_mask.size == time_arr.size, f"{sample_mask.size} != {time_arr.size}" | ||
time_arr = time_arr[sample_mask] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.5 * fs is the nyquist frequency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should be.
xcp_d/utils/restingstate.py
Outdated
|
||
assert alff.size == n_voxels, f"{alff.shape} != {n_voxels}" | ||
|
||
# Add second dimension to array | ||
# Add second dimension to arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to use .reshape(-1, 1)
for padding, but I don't think there's an official best way to do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think the Numpy-preferred method might be numpy.expand_dims
, but I don't feel strongly about it.
Add resting-state metric outputs.
Changes proposed in this pull request
uncensored_denoised_bold
data to the ALFF calculation node instead ofinterpolated_filtered_bold
, so ALFF and fALFF aren't calculated from bandpass filtered data.