Skip to main content

img2fmri: a python package for predicting group-level fMRI responses to visual stimuli using deep neural networks

Project description

img2fmri

img2fmri: a python package for predicting group-level fMRI responses to visual stimuli using deep neural networks

Users are encouraged to read the background science information for an overview of the model and its intended uses (science_overview.pdf).

Installation

To install, users must first install FSL and AFNI, two neuroimaging packages that we use in our pipeline to generate fMRI responses.

After cloning this repository, users should install Conda and create an environment with python 3.9, e.g.:

conda create --name name_of_environment python=3.9
conda activate name_of_environment

Users can enter this repository, then install package dependencies with:

cd img2fmri
python -m pip install -r requirements.txt

Users are now able to use the command-line interface for predicting fMRI responses as outlined in the section below.

Jupyter notebook installation

In order to run the jupyter notebook analyses in overview.ipynb, users should also install jupyter-lab and then ipykernel, in order to add your conda environment to jupyter-lab to use with the analyses.

python -m pip install jupyterlab
conda install ipykernel
ipython kernel install --user --name=name_of_environment

then refresh notebook to see and change the jupyter notebook's kernel to your new conda environment in top right corner.

Usage

Users are encouraged to view the overview.ipynb notebook, which shows the import and use of the img2fmri.predict() function, as well as its extension to movies using utils.extract_frames() and utils.load_frames().

img2fmri can also be used as a command-line interface, as:

    python img2fmri.py [-h] --input input_dir [--output output_dir] [--rois each roi here]
                        [--sigma sigma_val] [--center_crop center_crop]

Support or Questions

Users are encouraged to email Max Bennett with questions or issues.

License

This package is licensed under an MIT license in LICENSE.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

img2fmri-0.0.dev1.tar.gz (62.2 MB view hashes)

Uploaded Source

Built Distribution

img2fmri-0.0.dev1-py3-none-any.whl (62.3 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page