Skip to content
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

Rescale ALFF based on original BOLD standard deviation #1033

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Jan 16, 2024

Related to #1032.

Changes proposed in this pull request

  • Calculate the SD of the denoised BOLD data, then multiply the ALFF computed on the scaled BOLD data by that SD. This brings ALFF back to its original scale, and the censored version of ALFF will has the same scale as the uncensored version.

@tsalo tsalo added the bug Issues noting problems and PRs fixing those problems. label Jan 16, 2024
@tsalo tsalo changed the title Disable voxel-wise scaling in ALFF calculation Rescale ALFF based on original BOLD standard deviation Jan 16, 2024
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.27%. Comparing base (36e0370) to head (cc25c56).
Report is 144 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1033      +/-   ##
==========================================
+ Coverage   82.25%   82.27%   +0.01%     
==========================================
  Files          48       48              
  Lines        5776     5782       +6     
  Branches      767      767              
==========================================
+ Hits         4751     4757       +6     
  Misses        829      829              
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tsalo tsalo marked this pull request as ready for review January 16, 2024 16:29
docs/workflows.rst Show resolved Hide resolved
@@ -178,6 +184,8 @@ def compute_alff(data_matrix, low_pass, high_pass, TR, sample_mask=None):
# from the value closest to the low pass cutoff, to the value closest
# to the high pass pass cutoff
alff[i_voxel] = len(ff_alff) * np.mean(power_spectrum_sqrt[ff_alff[0] : ff_alff[1]])
# Rescale ALFF based on original BOLD scale
alff[i_voxel] *= sd_scale
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh so both periodogram and lombscargle get the scaling and rescaling?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though it's probably unnecessary for the periodogram version.

@tsalo tsalo merged commit a9294ec into PennLINC:main Jan 17, 2024
20 checks passed
@tsalo tsalo deleted the disable-scaling branch January 17, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues noting problems and PRs fixing those problems.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants