Skip to main content
NIfTI-MRS+ Logo

Efficient, backend-agnostic batching of NIfTI-MRS spectra

PyPI version Python License


nifti-mrs-plus wraps a list of NIfTI-MRS objects into a single batch-aware tensor, keeping the header, dimension tags, and provenance intact. It materializes in whatever backend your pipeline needs (NumPy, PyTorch, JAX, TensorFlow, or Keras) with no code changes.


Install

pip install nifti-mrs-plus                   # core (numpy + nifti-mrs)
pip install "nifti-mrs-plus[torch]"          # + PyTorch
pip install "nifti-mrs-plus[viz]"            # + plotting (matplotlib + fsl-mrs)
pip install "nifti-mrs-plus[all]"            # everything

Extras: torch · jax · tensorflow · keras · viz · hdf5 · all · dev


Quick start

from nifti_mrs_plus import NIfTI_MRS_Plus, Backend

batch = NIfTI_MRS_Plus(nifti_list)

batch.shape                          # (8, 1, 1, 1, 2048)
batch.numpy()                        # np.ndarray, cached
batch.get_data(Backend.PYTORCH)      # torch.Tensor  (if torch installed)
batch[0]                             # NIFTI_MRS  (single subject)
batch[0:4]                           # NIfTI_MRS_Plus  (sub-batch)

Backends

Extra Backend Returns
(none) NIFTI_LIST list[NIFTI_MRS]
(none) NUMPY numpy.ndarray
torch PYTORCH torch.Tensor
jax JAX jax.Array
tensorflow TENSORFLOW tf.Tensor
keras KERAS KerasTensor

Built with ❤️ for the MRS community

Metadata

Release files for nifti-mrs-plus 0.2.0

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

Source distribution (sdist)

Source distribution for nifti-mrs-plus 0.2.0
File Size Uploaded
nifti_mrs_plus-0.2.0.tar.gz 47.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nifti-mrs-plus 0.2.0
File Interpreter ABI Platform
nifti_mrs_plus-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 87.7 kB

Release files / nifti_mrs_plus-0.2.0.tar.gz

Download URL nifti_mrs_plus-0.2.0.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b850b5b4148ae9e40f2732adf1db95f4da1b20a4acead3a4b067b3af16fe38c7
BLAKE2b-256 checksum
How to use checksums
edfdf2a644c22f33087c6d6554e984302d6b4e1661f1a0a95e0faa49ef8a495d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / nifti_mrs_plus-0.2.0-py3-none-any.whl

Download URL nifti_mrs_plus-0.2.0-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0377397819d1a7765e03b374a9444c5a2d7711343dec7e75894cc6dcaa2b730
BLAKE2b-256 checksum
How to use checksums
37ca0179aac6a9a574b905ef8a577115ccaafea4dd83a1357849ebf69505bab1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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