Skip to main content

Python API to easily download stimuli and fMRI betas from Natural Scenes Dataset.

Project description

🧠🏞️ nsdget

PyPI - Version

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

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

nsdget-0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsdget-0.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for nsdget-0.0.2.tar.gz
Algorithm Hash digest
SHA256 097e432226195fcae2402653eb4f1421809b1b579d0dc30c4d510ff4a9554401
MD5 c9fe83d054b0d00b46db3126dd0728ec
BLAKE2b-256 5b6135130ca88f2553a3502d99fd7a13e297523c8c62af79327a01a071eb368b

See more details on using hashes here.

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

Hashes for nsdget-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 739adaf034df754493a74c471d211b1ab4e66b035c57a4e562e450dbd0fd372c
MD5 74da7a23146e1b92fcb4e58aa5ec33d5
BLAKE2b-256 f370264607a6f464d6dbb01c936054709857e23af8584467dc87a85e234b0692

See more details on using hashes here.

Supported by

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