A tool for generating study-specific MR spectroscopy basis sets directly from raw MRS data.
Project description
A tool for generating study-specific basis sets directly from raw MRS data, integrating real pulse shapes and acquisition parameters. This project is in its early development stages, and contributions, testing, and feedback are highly welcomed!
Prerequisites
For the recommended uvx quick start you do not
need to install Python yourself — uv downloads a compatible Python automatically.
You only need:
-
uv: installs Python and all dependencies into an isolated environment (one-line installer in Quick Start below). Nothing is installed globally. -
git: used the first time you run a simulation to fetch the third-party simulation toolboxes (and for cloning if you develop). -
Octave Runtime (simulation backends only): Version 4.0 or higher.
You have two options:
- Docker (Recommended) - Automatic setup, works everywhere
- Local Octave - Traditional installation
📖 See the Octave Setup Guide for detailed installation instructions.
Note: BasisREMY automatically detects and uses Docker if available, otherwise falls back to local Octave. Data extraction and parameter configuration work without an Octave runtime; only the simulation step requires it.
Python 3.10+ is only required if you skip
uvand install manually withpip(see Setting Up the Python Environment below).
Quick Start (for users)
The fastest way to run BasisREMY is with uv — a single
tool that installs Python for you (no manual Python, pip, or conda setup required).
1. Install uv (one time):
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2. Launch BasisREMY directly from the repository, without cloning:
uvx --from git+https://github.com/julianmer/BasisREMY basisremy
Or, for repeated use, install the command once and then run it by name:
uv tool install git+https://github.com/julianmer/BasisREMY
basisremy
uv automatically downloads a compatible Python and all dependencies into an
isolated environment — nothing is installed globally and your data never leaves
your machine.
Note on simulation backends: The simulation backends rely on third-party toolboxes that cannot be redistributed inside the wheel. The first time you run a simulation, BasisREMY fetches the toolbox it needs (at a pinned version) into a per-user data directory (
~/.basisremy, overridable via$BASISREMY_HOME).
Developer Setup
Clone the repository (with submodules) and let uv create the environment:
git clone --recurse-submodules https://github.com/julianmer/BasisREMY.git
cd BasisREMY
uv sync # creates .venv and installs all dependencies
uv run basisremy # launches the GUI
uv sync reads pyproject.toml, provisions a matching Python,
and installs everything into .venv. You do not need to activate the
environment — uv run handles that automatically. To include development tools
(pytest, coverage), run uv sync --extra dev.
Docker / Octave Requirements
Simulation backends execute MATLAB/Octave code and therefore need an Octave runtime. BasisREMY supports two interchangeable options and selects one automatically:
- Docker (recommended) — install Docker Desktop (macOS/Windows) or Docker Engine (Linux), and make sure it is running. BasisREMY pulls/builds an Octave container on demand.
- Local Octave — install Octave 4.0+ directly; it is used as a fallback when Docker is unavailable.
Whether an Octave runtime is needed is backend-dependent: data extraction and parameter configuration work without it; only the simulation step requires it. See the Octave Setup Guide for detailed instructions.
Troubleshooting
- GUI doesn't open /
ModuleNotFoundError: No module named 'nicegui'— the front-end is NiceGUI shown in a native desktop window via pywebview. They install automatically with the project (uv sync/uvx --from . basisremy); if you installed manually, runpip install nicegui pywebview. These are pure-pip packages, so no systemtcl/tkis required. - Window stays blank or pywebview errors — without
pywebviewthe UI falls back to opening in your browser; install it (pip install pywebview) for the native window. On Linux a system WebKitGTK package may be needed. - Simulation fails / "Octave not found" — start Docker Desktop/Engine, or install local Octave. See the Octave Setup Guide.
uv: command not found— re-open your terminal after installinguv, or add its install location to yourPATH.- Backends can't find
externals/...— the simulation toolboxes are fetched on first use into~/.basisremy(or$BASISREMY_HOME); make suregitis installed and you have network access the first time you run a simulation. In a cloned repository the existing submodules underexternals/are used as-is.
Setting Up the Python Environment (manual / pip)
The
uvquick start above is the recommended path. The steps below remain available if you prefer a manualvenv+pipworkflow.
It is recommended to use a virtual environment to isolate project dependencies. Start by cloning the repository.
git clone --recurse-submodules https://github.com/julianmer/BasisREMY.git
cd BasisREMY
Create and Activate the Virtual Environment
Windows:
python -m venv --prompt basisREMY .venv
.venv\Scripts\activate
macOS/Linux:
python3 -m venv --prompt basisREMY .venv
source .venv/bin/activate
Install Required Python Packages
Upgrade pip and install the required packages by running:
pip install --upgrade pip
pip install -r requirements.txt
Running BasisREMY
With all dependencies installed and your basisREMY environment activated, run the application:
python -m basisremy
This will launch the BasisREMY GUI. (Inside the repo you can equivalently use uv run basisremy.)
Usage Overview
BasisREMY guides you through a simple three-step workflow, shown as a numbered stepper at the top of the window (Data → Parameters → Simulate). You can click any completed step to go back and make changes. A light/dark theme toggle sits in the top-right corner and follows your system setting by default.
- Data — Drop your MRS data file onto the upload area (or click it to browse). Click Continue to automatically read the file and pre-fill the acquisition parameters, or Skip to configure everything manually.
- Parameters — Choose a simulation backend (grouped by category), review the auto-filled parameters, and tick the metabolites to include (Select all toggles the whole list). When the required fields are set, click Simulate basis set.
- Simulate — A progress bar shows the simulation status. When it finishes, an interactive spectrum plot appears and you can click Export basis… to save the basis set in LCModel, jMRUI, FSL-MRS, or Osprey format.
Every input has a small (?) help icon — hover it for a short explanation of that parameter.
Examples (No GUI)
Want to use BasisREMY programmatically? Check out the examples/ folder!
Quick start:
python examples/basic_usage.py
The example shows how to:
- Load MRS data and extract parameters automatically
- Configure and run simulations without the GUI
- Customize metabolite lists and output settings
Related References
The project will build upon the methodologies used in existing tools. Some references include:
- REMY and related literature (nbm.70039)
- FID-A and related literature (mrm.26091)
- FSL-MRS and related literature (mrm.28630)
- MRSCloud and related literature (mrm.29370)
- BasisSetSimulation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basisremy-0.1.1.tar.gz.
File metadata
- Download URL: basisremy-0.1.1.tar.gz
- Upload date:
- Size: 19.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e88a5360568a2b4b3cc5256aa3eb9ba5cefb824faf1a493ca32a6fa0d56dccbd
|
|
| MD5 |
0f4766621f5652548a244d7b068034bd
|
|
| BLAKE2b-256 |
9b40050daa112cf186a3f1909cf059d850f9df2a832f4b599329ea7045f32fb3
|
File details
Details for the file basisremy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: basisremy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7221b1a4cfed39ad2fd2d8f5fe2e13e533c0ada37fec5bd851c15c256d15acb1
|
|
| MD5 |
fbcb42efc20481b8c4f8b4050e671727
|
|
| BLAKE2b-256 |
61afced1896978c9c4696ee7812af289de08a98af5f3a529b09f16c8b7e7a25f
|