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

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.0.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.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lcmodel_wrapper-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b0992cd81d450e5ab00978594a167b4ae49da4624da68f48263157667624cb69
MD5 81f7d771bf2e0cc562b53f260d0ea9c0
BLAKE2b-256 21d07fa5032af6d496d61883ee601b1a6a6560a657848cb9cb8a7565fbd60bb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lcmodel_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58ae125e3a295f69ef11776595043eb8d0b75816cd467ba8a800b6451cd1b9f3
MD5 65679cbad15aaf3c2501bef0f64a9766
BLAKE2b-256 e598865401bc81cc7a3b2b1b4f4de1f0e56d552d7c464f9f063d3108e8a395af

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