Giter Club home page Giter Club logo

texturemodel's Introduction

Code to construct/analyze a texture statistics encoding model for fMRI data.

Related to our paper:

Henderson, M.M., Tarr, M.J., & Wehbe, L. (2023). A texture statistics encoding model reveals hierarchical feature selectivity across human visual cortex. Journal of Neuroscience. https://doi.org/10.1523/JNEUROSCI.1822-22.2023

Setup instructions:

  1. Clone the repository:
  2. Edit "root" in path_defs.py to reflect the name of the folder into which you cloned this repository.
  3. If using our pre-computed model fits: download the data from OSF
    • https://osf.io/8fsnx/
    • After unzipping, you should have a folder "model_fits", which can be placed inside "texturemodel".
    • You should also have a folder "rois", which should be placed at: /root/nsd/rois
  4. If fitting from scratch: access the fMRI dataset (NSD) and images here:
    • http://naturalscenesdataset.org/
    • Update path_defs.py to reflect the path where NSD is downloaded.
    • Use "/code/run/prep_images.sh" to prepare the NSD images for feature extraction pipeline.
  5. Use the jupyter notebooks inside "notebooks" to plot the results of model fitting, and reproduce all our figures.

Feature extraction:

The first step of the fitting procedure is to extract texture statistics features using a steerable pyramid representation. Our code is adapted from the Matlab code available at: https://github.com/freeman-lab/metamers.

Running the feature extraction code requires PyTorch as well as PyrTools (https://pyrtools.readthedocs.io/en/latest/). Using a GPU is recommended for speed.

See "code/run/extract_texture_feats.sh" for an example of how to run the feature extraction code (adjust the paths in this script for your local filesystem).

Model fitting:

See the scripts in "code/run/fit..." for examples of how to run fitting code (adjust the paths in these scripts for your local filesystem).

To fit the models, you'll need to first download the NSD dataset, and run the feature extraction code.

Other notes:

Any questions/concerns can be directed to [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.