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
Metadata
Release files for telenib 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 | |
|---|---|---|---|
| telenib-0.0.2.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telenib-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / telenib-0.0.2.tar.gz
| Download URL | telenib-0.0.2.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1a17f277051a800c80888351a5fa22d9d409c23171d5cd176905deadf896a18
|
|
BLAKE2b-256 checksum How to use checksums |
a6844b3a2c54e2b6dac9444966f739733f190fa0a98a80534f56c2628d57e501
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / telenib-0.0.2-py3-none-any.whl
| Download URL | telenib-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
050d9c2bc5c220df367dea9ad54bddd298be3d1c6f372e2d7bd8423d451361db
|
|
BLAKE2b-256 checksum How to use checksums |
1bfade7009ca84e8e151e5d1672b59cd5ff1bc45eb3fccced767601e36def7bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|