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

`reshape_niimg()` may be too flexible #1070

Open tsalo opened 2 months ago

tsalo commented 2 months ago

Summary

reshape_niimg is more flexible than documented. reshape_niimg will sometimes take as input a file name, sometimes a 3D image array, and sometimes a 1D image array. It seems to work for all those conditions.

If it's a file name, it loads the file and then reshapes and if it's already a loaded image, it just uses it. If it's already 1D, it squeezes the file and is still 1D.

Additional Detail

Stems from https://github.com/ME-ICA/tedana/pull/1060#issuecomment-2043671230.

handwerkerd commented 1 month ago

From our April 2024 dev call, the decision is that the function has fine behavior, but we should update the document to accurately reflect what the function can do.