Skip to main content

Fetch metadata from remote (https) nifti (gzipped or not).

Project description

telenib

Read header of remote nifti according to nifti1 spec and nifti2 spec either gzipped or not.

Requirements

server must support RANGE request.

  • requests
  • nibabel

Why?

For large nifti files, it is often not feasible to download the full nifti file in order to access the header.

Installation

  • via pip
pip install telenib

Usage

from telenib import get_nii_header
from nibabel import Nifti1Header, Nifti2Header

nii_url="https://nifti.nimh.nih.gov/nifti-1/data/avg152T1_RL_nifti.nii.gz"
tele_header = get_nii_header(nii_url)

assert isinstance(tele_header, Nifti1Header) or isinstance(tele_header, Nifti2Header)

One could also add any custom header

from telenib import get_nii_header

# from https://nifti.nimh.nih.gov/nifti-1/data
nii_url="https://my.example.co/my/dir/nii.nii.gz"
tele_header = get_nii_header(nii_url, headers={
    'Authorization': f'token my-secret-token'
})

print(tele_header)

License

MIT

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

telenib-0.0.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

telenib-0.0.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file telenib-0.0.2.tar.gz.

File metadata

  • Download URL: telenib-0.0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for telenib-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f1a17f277051a800c80888351a5fa22d9d409c23171d5cd176905deadf896a18
MD5 7f8f88056e4b807cc3ec3ba11d19787d
BLAKE2b-256 a6844b3a2c54e2b6dac9444966f739733f190fa0a98a80534f56c2628d57e501

See more details on using hashes here.

File details

Details for the file telenib-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: telenib-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for telenib-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 050d9c2bc5c220df367dea9ad54bddd298be3d1c6f372e2d7bd8423d451361db
MD5 41eafff84da8d554b40257f5c17278cf
BLAKE2b-256 1bfade7009ca84e8e151e5d1672b59cd5ff1bc45eb3fccced767601e36def7bb

See more details on using hashes here.

Supported by

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