🧠🏞️ 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
Metadata
Release files for nsdget 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nsdget-0.0.2.tar.gz | 5.8 kB | Without provenance | Details for nsdget-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nsdget-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for nsdget-0.0.2-py3-none-any.whl |
Total release size: 12.1 kB
Release files / nsdget-0.0.2.tar.gz
| Download URL | nsdget-0.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
097e432226195fcae2402653eb4f1421809b1b579d0dc30c4d510ff4a9554401
|
|
BLAKE2b-256 checksum How to use checksums |
5b6135130ca88f2553a3502d99fd7a13e297523c8c62af79327a01a071eb368b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|
Release files / nsdget-0.0.2-py3-none-any.whl
| Download URL | nsdget-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
739adaf034df754493a74c471d211b1ab4e66b035c57a4e562e450dbd0fd372c
|
|
BLAKE2b-256 checksum How to use checksums |
f370264607a6f464d6dbb01c936054709857e23af8584467dc87a85e234b0692
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|
Security for nsdget 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.