Skip to content

Fixed some errors and tried to improve usability#1

Open
marms7 wants to merge 1 commit intoTengfeiFeng:mainfrom
marms7:main
Open

Fixed some errors and tried to improve usability#1
marms7 wants to merge 1 commit intoTengfeiFeng:mainfrom
marms7:main

Conversation

@marms7
Copy link

@marms7 marms7 commented Feb 10, 2026

Summary

I was playing around with this code and noticed some things that seemed miscopied from whatever code was used to generate the figures in the associated journal article. I figured I would share my changes in case it's useful to the next person.

Changes

  • The first time coeff was defined, one of the inputs to the polyfit function was TE_modes indexed in one dimension by second_level_comp, which was blank. Indexing by a blank array was giving an error, so I changed the input to be TE_modes.
  • When the component identify function was run, it was being assigned to an array of the wrong dimension (as a variable for reject_comp_1 was excluded). I added this variable.
  • nilearn._utils is an outdated library so I updated it to nilearn.image.
  • Fixed typo "ploting" changed to "plotting".
  • Number of echoes was hardcoded which made it difficult to use for new data. Created an echo_times variable and added it as an input to the component_identify function. This variable is used within the function to set additional variables num_echoes (number of echo times in the echo_times variable) and interp_degree (number of echoes - 1). Note that the degree of the polynomial was hardcoded but possibly incorrectly set to 2 (rather than 3) in the original code.
    • There are some hardcoded thresholds, it is unclear if any should change with number of echoes. I kept them as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant