cosanlab / nltools

Python toolbox for analyzing imaging data
https://nltools.org
MIT License
121 stars 44 forks source link

Update Download Datasets #431

Open ljchang opened 5 months ago

ljchang commented 5 months ago

This PR updates nltools to accomodate the new functionality provided by nilearn version 0.10.4 to download and upload to neurovault.

Addresses Issues: #429 and #422

ljchang commented 5 months ago

@ejolly I thought this was a WIP, but now I'm wondering if I've fixed the main issues. Basically, nilearn revamped how they were interfacing with nilearn. it actually looks like they did a nice job rethinking everything, but their new solution isn't really backwards compatible.

I just added a check to use either the new version or the old version for fetch_pain() and fetch_emotion_ratings() depending on the version of nilearn in the users environment. It's a little kludgy, but will ensure backwards compatibility.

I did not change any of the other helper functions as the download_nifti function doesn't use any nilearn code and the other two functions have now been replaced by nilearns new fetch_neurovault_ids function.

All of the tests are passing on my local version of python 3.11, if you want to review the code. It seems like we didn't have tests for the dataset module yet, which I guess we could add now.