Skip to main content

🧠🏞️ nsdget

PyPI - Version

nsdget: easily download and use the single trial betas 1.8mm and coco images from the Natural Scenes Dataset

Note: I'm 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).

Shoutout to https://github.com/clane9/NSD-Flat/ since I reused some of the functions from there. Thank you!

Usage

To use the data, please fill out the NSD Data Access Agreement first. Then download the nsdget python package:

Install

uv add nsdget

or

pip install nsdget

Then, to download the betas for all 8 subjects and 73k coco images do

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)

Example above ran in example.ipynb.

Note that download happens only once. After the first slow run, subsequent runs will be very fast.

Development

Dev run

uv sync
make run

Deployment PyPi

uv sync
TOKEN=... make publish # insert your PyPi token where ...

References

Metadata

Release files for nsdget 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nsdget 0.0.3
File Size Uploaded Provenance Actions
nsdget-0.0.3.tar.gz 6.0 kB Without provenance Details for nsdget-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nsdget 0.0.3
File Interpreter ABI Platform Actions
nsdget-0.0.3-py3-none-any.whl Python 3 none any Details for nsdget-0.0.3-py3-none-any.whl

Total release size: 12.5 kB

Release files / nsdget-0.0.3.tar.gz

Download URL nsdget-0.0.3.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2c26d2375e6dcecc41a4a83e08764e78389b90437a4f7aab0c4416b866c914bb
BLAKE2b-256 checksum
How to use checksums
1cd011596b079b6bd975fd041b3855401e464ea68e08e815c8e173babe299a09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.3

Release files / nsdget-0.0.3-py3-none-any.whl

Download URL nsdget-0.0.3-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e73eed8907cb616cdb277ccefadf895d318ba5b76f944f83a018946667289a40
BLAKE2b-256 checksum
How to use checksums
08f4dba8e4d41d189fd9ead2566af4b65f14cbe1a53dd3b2f10527cfbe80e1d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.3

Security for nsdget 0.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page