Skip to main content

Python wrapper for LCModel MRS fitting

Project description

PyLCModel

PyLCModel is a Python wrapper designed to streamline the use of LCModel for least-squares spectral fitting in MRS. It takes the complexity out of setting up LCModel by automating control file generation, handling data conversions, and managing execution (with support for both single and multi-core processing).


Features

  • Easy Setup: Quickly run LCModel with minimal code.
  • Automated Control Files: Dynamically generates and adjusts LCModel control files to suit your data.
  • Multiprocessing Support: Leverage multiple cores to accelerate batch processing.
  • Data Conversion: Seamlessly converts to .raw for execution. (Coming soon: conversion to .basis)
  • Robust Output Parsing: Extracts metabolite concentrations and CRLBs from LCModel output.

Installation

From PyPI

pip install lcmodel-wrapper

From Source

git clone https://github.com/julianmer/PyLCModel.git
cd PyLCModel
pip install -e .

Getting Started

from lcmodel_wrapper import PyLCModel

# Initialize the LCModel wrapper with your basis set
lcmodel = PyLCModel(path2basis='/path/to/your/basis_set.basis')

# Assuming `data` is your MRS data in the frequency domain as a NumPy array
# Fit the data using LCModel
concentrations, crlbs = lcmodel(data)

# Print results
print("Fitted Metabolite Concentrations:", concentrations)
print("CRLBs:", crlbs)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lcmodel_wrapper-0.1.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lcmodel_wrapper-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file lcmodel_wrapper-0.1.2.tar.gz.

File metadata

  • Download URL: lcmodel_wrapper-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lcmodel_wrapper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 523e0d6d4367db24fc890b0352f0a40b237e5ecbbd2abafed4f0233a80a12c2e
MD5 9829047891d9ac27b9dcb6a225d5979f
BLAKE2b-256 764608c668195576e85df897dcdfa42fe4b75aba4a03e637a5ec0608e790929b

See more details on using hashes here.

File details

Details for the file lcmodel_wrapper-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lcmodel_wrapper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26421a9549bbf4b274bef379cbeed7ca0fcdad3e191adff5c2675d8a5038cc97
MD5 450b5ebf0edf5430a98c16610e2f0869
BLAKE2b-256 7a1d605550b0c176bee1c638452a42bb6c972ba212ead06100d8087422c3cf42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page