ME-ICA / tedana

TE-dependent analysis of multi-echo fMRI
https://tedana.readthedocs.io
GNU Lesser General Public License v2.1
158 stars 94 forks source link

FIX load user-defined mask as expected by plot_adaptive_mask #1079

Closed mvdoc closed 2 months ago

mvdoc commented 2 months ago

When passing a brainmask, tedana would crash when running the plot_adaptive_mask function. This function expects an array, but the mask was never explicitly loaded when passed by the user.

Example traceback with error

Traceback (most recent call last):
  File "/home/jlg/mvdoc/miniconda3/envs/sosem/bin/tedana", line 8, in <module>
    sys.exit(_main())
  File "/home/jlg/mvdoc/repos/tedana/tedana/workflows/tedana.py", line 946, in _main
    tedana_workflow(**kwargs, tedana_command=tedana_command)
  File "/home/jlg/mvdoc/repos/tedana/tedana/workflows/tedana.py", line 903, in tedana_workflow
    reporting.static_figures.plot_adaptive_mask(
  File "/home/jlg/mvdoc/repos/tedana/tedana/reporting/static_figures.py", line 651, in plot_adaptive_mask
    base_mask = io.new_nii_like(io_generator.reference_img, base_mask)
  File "/home/jlg/mvdoc/repos/tedana/tedana/io.py", line 794, in new_nii_like
    newdata = data.reshape(ref_img.shape[:3] + data.shape[1:])
AttributeError: 'str' object has no attribute 'reshape'

Closes none .

Changes proposed in this pull request:

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 89.79%. Comparing base (5835d3a) to head (141a3d7).

Files Patch % Lines
tedana/workflows/tedana.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1079 +/- ## ========================================== - Coverage 89.81% 89.79% -0.03% ========================================== Files 26 26 Lines 3536 3537 +1 Branches 620 620 ========================================== Hits 3176 3176 - Misses 211 212 +1 Partials 149 149 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

handwerkerd commented 2 months ago

@all-contributors please add @mvdoc for code, bug, and doc

allcontributors[bot] commented 2 months ago

@handwerkerd

I've put up a pull request to add @mvdoc! :tada: