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 Source

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

From PyPI (once published)

pip install lcmodel-wrapper

Getting Started

from lcmodel_wrapper import LCModel

# Initialize the LCModel wrapper with your basis set
lcmodel = LCModel(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.1.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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lcmodel_wrapper-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 09828a25acb8a35a18be6f26f1d0fb87d77bb9a9a9c2a4f10e9d15861a94ce8f
MD5 6135dae05574a6777c56daa46760b377
BLAKE2b-256 de4a8ed002eaed377b639d4b7d8d204d1e356d704449236cac849c4bfb97a112

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lcmodel_wrapper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 915e09482128f6dd492964569f3b9b72ace1c62e1b79ba1cb37c78d2524402cf
MD5 e8e7ab677a9c929774a31c17068c27ed
BLAKE2b-256 c8576d9a2fdd6fa2511be3a1bd508b5aac6b761f05b2f3892fe7b7ed61f41fde

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