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

Duplicated text in reports #638

Closed
tsalo opened this issue Dec 30, 2020 · 1 comment · Fixed by #645
Closed

Duplicated text in reports #638

tsalo opened this issue Dec 30, 2020 · 1 comment · Fixed by #645
Labels
bug issues describing a bug or error found in the project reports issues related to boilerplate generation or visual reports

Comments

@tsalo
Copy link
Member

tsalo commented Dec 30, 2020

Summary

At minimum, the optimal combination step is duplicated in our report text and visual reports. We should review the logging code to ensure that report text is only logged once, as appropriate.

In the five-echo test's current report (emphasis mine):

TE-dependence analysis was performed on input data. An adaptive mask was then generated, in which each voxel's value reflects the number of echoes with 'good' data. Multi-echo data were then optimally combined using the T2* combination method (Posse et al., 1999). Multi-echo data were then optimally combined using the T2* combination method (Posse et al., 1999). Multi-echo data were then optimally combined using the T2* combination method (Posse et al., 1999). Next, components were manually classified as BOLD (TE-dependent), non-BOLD (TE-independent), or uncertain (low-variance). This workflow used numpy (Van Der Walt, Colbert, & Varoquaux, 2011), scipy (Jones et al., 2001), pandas (McKinney, 2010), scikit-learn (Pedregosa et al., 2011), nilearn, and nibabel (Brett et al., 2019). This workflow also used the Dice similarity index (Dice, 1945; Sørensen, 1948).

Additional Detail

Next Steps

  1. Review logging code
  2. Eliminate duplicated text by adding a report argument to the relevant functions and setting to False when called 2+ times. See fit_loglinear for an example:
    def fit_loglinear(data_cat, echo_times, adaptive_mask, report=True):
@tsalo tsalo added bug issues describing a bug or error found in the project documentation issues related to improving documentation for the project reports issues related to boilerplate generation or visual reports and removed documentation issues related to improving documentation for the project labels Dec 30, 2020
@notZaki
Copy link
Contributor

notZaki commented Dec 30, 2020

As a starting point for that specific case, the duplicate messages are from multiple calls to tedana.combine._combine_t2s in the following loop:

tedana/tedana/combine.py

Lines 218 to 228 in 45e5ad7

for echo in np.unique(adaptive_mask[mask]):
echo_idx = adaptive_mask[mask] == echo
if combmode == 'paid':
combined[echo_idx, :] = _combine_paid(data[echo_idx, :echo, :],
tes[:echo])
else:
t2s_ = t2s[mask, ..., np.newaxis] # mask out empty voxels/samples
combined[echo_idx, :] = _combine_t2s(
data[echo_idx, :echo, :], tes[:, :echo], t2s_[echo_idx, ...])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues describing a bug or error found in the project reports issues related to boilerplate generation or visual reports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants