read_nii_to_numpy
Read the NIfTI file and resample it into a 3D NumPy array.
Installation
pip install read_nii_to_numpy
Usage
from read_nii_to_numpy import nii_file_original_zoom, nii_file_to_numpy
# Get original zoom
# the output (x_len, y_len, z_len) means:
# 1 voxel in x direction corresponds to x_len (mm)
# 1 voxel in y direction corresponds to y_len (mm)
# 1 voxel in z direction corresponds to z_len (mm)
print(nii_file_original_zoom("CT.nii"))
# Get original data matrix
odm = nii_file_to_numpy("CT.nii")
print(odm.shape)
# Get reshaped data matrix
rdm = nii_file_to_numpy("CT.nii", 1.0, 1.0, 1.0)
print(rdm.shape)
Metadata
Release files for read-nii-to-numpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| read_nii_to_numpy-0.1.0.tar.gz | 2.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| read_nii_to_numpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.0 kB
Release files / read_nii_to_numpy-0.1.0.tar.gz
| Download URL | read_nii_to_numpy-0.1.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3887b52bd79c1ca5b9a67ef307c837220cc1d03dc4863fc6ab0623d4127bb535
|
|
BLAKE2b-256 checksum How to use checksums |
298e72f1dac138ddd2a57a632ca3ede89d2954de4dfd36386078b30dab18660b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.10.20 Windows/10
|
Release files / read_nii_to_numpy-0.1.0-py3-none-any.whl
| Download URL | read_nii_to_numpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54a28250401aa2defa6e27f402fd5f6196e35d04a1d5b26c9bb07aeb204c9060
|
|
BLAKE2b-256 checksum How to use checksums |
af7258869c891a868414439fd1150edb5a5440b1aea72e864ec5e99250c3c569
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.10.20 Windows/10
|