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

Refactor gscontrol module #1086

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Refactor gscontrol module #1086

wants to merge 12 commits into from

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Apr 21, 2024

Closes #1085 (but perhaps not optimally?)

Changes proposed in this pull request:

  • Add type hints to gscontrol.gscontrol_raw and gscontrol.minimum_image_regression.
  • Use the same variable names from metric calculation within these two functions as well. E.g., data_cat instead of catd.
  • Require function calls to use keyword arguments.
  • Add verbose parameter to gscontrol.minimum_image_regression. Only write out the accepted MIR outputs if verbose=True.
    • Note that these are only composed of non-low-variance components at the moment.
  • In minimum_image_regression, use classification tags to split up accepted components into BOLD-like and low-variance groups, to match the old "accepted" and "ignored" classifications.

@tsalo tsalo added the refactoring issues proposing/requesting changes to the code which do not impact behavior label Apr 21, 2024
@tsalo tsalo requested a review from handwerkerd April 21, 2024 15:11
Copy link

codecov bot commented Apr 21, 2024

Codecov Report

Attention: Patch coverage is 95.71429% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 89.87%. Comparing base (0f6cbe1) to head (c491cc3).

Files Patch % Lines
tedana/gscontrol.py 94.91% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
- Coverage   89.91%   89.87%   -0.05%     
==========================================
  Files          26       26              
  Lines        3621     3634      +13     
  Branches      629      632       +3     
==========================================
+ Hits         3256     3266      +10     
- Misses        214      216       +2     
- Partials      151      152       +1     

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

Comment on lines +18 to +19
data_cat: np.ndarray,
data_optcom: np.ndarray,
Copy link
Member Author

Choose a reason for hiding this comment

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

We use data_oc instead of data_optcom in many places. Not sure which one we want to commit to, but I'd like to decide before merging this.

data_cat_nogs : (S x E x T) array_like
Input ``data_cat`` with global signal removed from time series.
data_optcom_nogs : (S x T) array_like
Input ``data_optcom`` with global signal removed from time series.
"""
LGR.info("Applying amplitude-based T1 equilibration correction")
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this accurate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring issues proposing/requesting changes to the code which do not impact behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minimum image regression relies on distinction between "accepted" and "ignored" components
1 participant