Metadata-Version: 2.4
Name: nifti-mrs-plus
Version: 0.1.0
Summary: Efficient, backend-agnostic batching of NIfTI-MRS spectra (NumPy / PyTorch / JAX / TensorFlow / Keras)
Author-email: "Julian P. Merkofer" <j.p.merkofer@tue.nl>
License: Apache-2.0
Project-URL: Homepage, https://github.com/julianmer/nifti-mrs-plus
Project-URL: Repository, https://github.com/julianmer/nifti-mrs-plus
Project-URL: Bug Tracker, https://github.com/julianmer/nifti-mrs-plus/issues
Keywords: MRS,spectroscopy,NIfTI-MRS,medical imaging,machine learning,batching
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21.0
Requires-Dist: nifti-mrs>=0.1.0
Provides-Extra: torch
Requires-Dist: torch>=1.10.0; extra == "torch"
Provides-Extra: jax
Requires-Dist: jax>=0.4.0; extra == "jax"
Requires-Dist: jaxlib>=0.4.0; extra == "jax"
Provides-Extra: tensorflow
Requires-Dist: tensorflow>=2.8.0; extra == "tensorflow"
Provides-Extra: keras
Requires-Dist: keras>=3.0.0; extra == "keras"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.4.0; extra == "viz"
Provides-Extra: hdf5
Requires-Dist: h5py>=3.0.0; extra == "hdf5"
Provides-Extra: all
Requires-Dist: torch>=1.10.0; extra == "all"
Requires-Dist: jax>=0.4.0; extra == "all"
Requires-Dist: jaxlib>=0.4.0; extra == "all"
Requires-Dist: tensorflow>=2.8.0; extra == "all"
Requires-Dist: keras>=3.0.0; extra == "all"
Requires-Dist: matplotlib>=3.4.0; extra == "all"
Requires-Dist: h5py>=3.0.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
Requires-Dist: matplotlib>=3.4.0; extra == "dev"
Requires-Dist: h5py>=3.0.0; extra == "dev"
Dynamic: license-file

<div align="center">
  <img src="assets/logo.svg" alt="NIfTI-MRS+ Logo" width="200"/>
  <p><em>Efficient, backend-agnostic batching of NIfTI-MRS spectra</em></p>

  [![PyPI version](https://badge.fury.io/py/nifti-mrs-plus.svg)](https://badge.fury.io/py/nifti-mrs-plus)
  [![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
</div>

---

`nifti-mrs-plus` wraps a list of [NIfTI-MRS](https://github.com/wtclarke/mrs_nifti_standard)
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

```bash
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

```python
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` | Keras tensor |

---

<div align="center">
  <sub>Built with ❤️ for the MRS community</sub>
</div>
