Skip to main content

A toolbox for laminar inference with MEG

Project description

laMEG

Toolbox for laminar inference with MEG, powered by FreeSurfer and SPM

PyPI version Unit tests codecov linting: pylint Python 3.7 License: GPL v3 Repo Size PyPI - Downloads

Operating system

  • Windows: Tested on WSL (using Ubuntu 24.04.1), follow instructions here

  • Mac: May work, not tested

  • Linux: Tested on Ubuntu and Debian

Requirements

Upgrade Notice (v0.1.0)

If you used laMEG versions prior to v0.1.0, the internal format of laminar surface directories has changed. They are now stored within <SUBJECTS_DIR>/<subject_id>/surf/laminar, and <SUBJECTS_DIR>/<subject_id>/mri/orig.mgz is automatically used for co-registration. Older surfaces must be converted before they can be loaded with the new LayerSurfaceSet interface.

Run the conversion script:

python convert_legacy_surfaces.py <subject_id> <path_to_old_lameg_surf_dir>

For example:

python convert_legacy_surfaces.py sub-104 /data/old_surfaces/sub-104

This will rebuild the standardized hierarchy under:

<SUBJECTS_DIR>/<subject_id>/surf/laminar

and generate complete metadata for each processing stage.

After conversion, you can validate the new structure:

from lameg.surf import LayerSurfaceSet
surf_set = LayerSurfaceSet('sub-104', 11)
surf_set.validate()

Installation

  1. Install git and curl if needed:

    sudo apt-get install git curl
  2. Create a conda environment:

    conda create -n <env name> python=3.7

    replacing <env name> with the name of the environment you would like to create (i.e. ‘lameg’, or the name of your project)

  3. Activate the environment:

    conda activate <env name>

    replacing <env name> with name of the environment you created.

  4. Install FreeSurfer, following the instructions on this page

  5. To install laMEG, run:

    pip install lameg

    Then run the post-installation script:

    lameg-postinstall

    This installs SPM standalone and Matlab runtime, which can take some time depending on your connection speed.

  6. Before using, deactivate and reactivate the environment for changes to environment variables to take effect:

    conda deactivate
    conda activate <env name>
  7. If you want to run the tutorials, download and extract the test data

Documentation and Tutorials

Once you have installed laMEG, check out the example notebooks, tutorials, and documentation. For guidelines on MRI sequences, head-cast construction, and co-registration, see the wiki

Funding

Supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme grant agreement 864550, and a seed grant from the Fondation pour l’Audition.

ERC FPA

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

lameg-0.1.2.tar.gz (13.8 MB view details)

Uploaded Source

Built Distribution

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

lameg-0.1.2-py3-none-any.whl (13.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lameg-0.1.2.tar.gz
  • Upload date:
  • Size: 13.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for lameg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 14fa9b93d3bc372650108f49dd44bccd24d2f0b526c58e5580da08d258f0a8d1
MD5 7fb2bacf534dfd39839574ce0bc91dae
BLAKE2b-256 aaf5aee17e57b5e80c2aad29c1ec2125b2b7c898ceedcacb3824b11e1de180ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lameg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for lameg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7834a13753ef5798fb5c0d315bed0abe6386fb61ad4ad4250573a3857bc68e26
MD5 c023037943ccb40be459d3a5ceb4beca
BLAKE2b-256 3a00cc1d1492f54c98388ffd6f32d345daf535326f36c1f790fc758a45818d15

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