Python API to easily download stimuli and fMRI betas from Natural Scenes Dataset.
Project description
🧠🏞️ nsdget
nsdget: Download Natural Scenes Dataset images and fMRI without downloading the entire dataset.
Quickly get a subset of stimuli (images shown to subject) and corresponding fMRI data from the Natural Scenes Dataset.
Not affiliated with Natural Scenes Dataset. I just wanted an easier and quicker way to download the data I needed from them (hence this package).
Usage
To use the data, first submit a form to the NSD people: NSD Data Access Agreement. Then,
Install
uv add nsdget
or
pip install nsdget
API
Simple API, all there is:
from nsdget import nsd_betas_images_trials, nsd_coco_image, nsd_single_trial_betas
# download and use data
df: pd.DataFrame = nsd_betas_images_trials(save_to="./nsdata/")
betas: np.ndarray = sd_single_trial_betas(df.iloc[0]) # 1.8mm res fmri single trial from NSD for the given row (index 0 here)
image0: PIL.Image = nsd_coco_image(df.iloc[0]) # crops how NSD did and gives you the PIL image (can easily be converted to numpy too)
Development
uv sync
uv run nsdget
References
- https://naturalscenesdataset.org/ (Allen, St-Yves, Wu, Breedlove, Prince, Dowdle, Nau, Caron, Pestilli, Charest, Hutchinson, Naselaris*, & Kay*. A massive 7T fMRI dataset to bridge cognitive neuroscience and artificial intelligence. Nature Neuroscience (2021).)
- https://cocodataset.org/#home
- https://github.com/clane9/NSD-Flat/blob/b6851300ea3778eae7e4dbb88a85d71ce18cb9a5/generate_dataset.py#L157
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nsdget-0.0.2.tar.gz.
File metadata
- Download URL: nsdget-0.0.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
097e432226195fcae2402653eb4f1421809b1b579d0dc30c4d510ff4a9554401
|
|
| MD5 |
c9fe83d054b0d00b46db3126dd0728ec
|
|
| BLAKE2b-256 |
5b6135130ca88f2553a3502d99fd7a13e297523c8c62af79327a01a071eb368b
|
File details
Details for the file nsdget-0.0.2-py3-none-any.whl.
File metadata
- Download URL: nsdget-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739adaf034df754493a74c471d211b1ab4e66b035c57a4e562e450dbd0fd372c
|
|
| MD5 |
74da7a23146e1b92fcb4e58aa5ec33d5
|
|
| BLAKE2b-256 |
f370264607a6f464d6dbb01c936054709857e23af8584467dc87a85e234b0692
|