Skip to main content

codecov

Documentation Status

logo

Introduction to the Lossless Pipeline

This EEG processing pipeline is especially useful for the following scenarios:

  • You want to keep your EEG data in a continuous state, allowing you the flexibility to epoch your data at a later stage.
  • You are part of a research team or community that shares a common dataset, and you want to process the data once in a way that can be used for multiple analyses (i.e., one analysis can segment the cleaned data into 10-second epochs and filter the data betweeen 1-30Hz, while another analysis can use 1-second epochs with no filter, etc.)
  • You want to be able to do a hands on review of the pre-processing results for each file.

📘 Installation and usage instructions

The development version can be installed from GitHub with

$ git clone git@github.com:lina-usc/pylossless.git
$ pip install --editable ./pylossless

for an editable installation, or simply with

$ pip install git+https://github.com/lina-usc/pylossless.git

for a static version.

Please find the full documentation at pylossless.readthedocs.io.

▶️ Running the pyLossless Pipeline

Below is a minimal example that runs the pipeline one of MNE's sample files.

from pathlib import Path
import pylossless as ll 
import mne
import mne_bids
fname = mne.datasets.sample.data_path() / 'MEG' / 'sample' /  'sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname, preload=True).pick("eeg")

config = ll.config.Config()
config.load_default()

pipeline = ll.LosslessPipeline(config=config)
pipeline.run_with_raw(raw)

Once it is completed, You can see what channels and times were flagged:

print(pipeline.flags['ch']
print(pipeline.flags['epoch']

Once you are ready, you can save your file in its lossless state:

bpath = mne_bids.BIDSPath(root=Path.cwd(), subject="sample", task="audvis")
pipeline.save(pipeline.get_derivative_path(bids_path), overwrite=True)

To get a cleaned version, you can use a RejectionPolicy object to apply these annotations to your raw object. This is a lossy operation:

rejection_policy = ll.RejectionPolicy()
cleaned_raw = rejection_policy.apply(pipeline)

👩‍💻 Dashboard Review

Open in Colab

QCR Dashboard

After running the Lossless pipeline, you can launch the Quality Control Review (QC) dashboard to review the pipeline's decisions on each file! You can flag additional channels, times and components, and edit flags made by the pipeline.

First install the dashboard requirements

$ cd ./path/to/pylossless/on/your/computer
$ pip install --editable .[dash]
$ pylossless_qc

▶️ Example HPC Environment Setup

If you are a Canadian researcher working on an HPC system such as Narval:

module load python/3.10

# Build the virtualenv in your homedir
cd ~
virtualenv --no-download eeg-env
source eeg-env/bin/activate

pip install --no-index mne
pip install --no-index pandas
pip install --no-index xarray
pip install --no-index pyyaml
pip install --no-index sklearn
pip install mne_bids
pip install edfio
pip install openneuro-py

pip install mne-icalabel

pip install --no-deps pylossless

# Verify that the package has installed correct with an import
python -c 'import pylossless'

Metadata

Release files for pylossless 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylossless 0.3.0
File Size Uploaded Provenance Actions
pylossless-0.3.0.tar.gz 49.9 MB With provenance Details for pylossless-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylossless 0.3.0
File Interpreter ABI Platform Actions
pylossless-0.3.0-py3-none-any.whl Python 3 none any Details for pylossless-0.3.0-py3-none-any.whl

Total release size: 99.6 MB

Release files / pylossless-0.3.0.tar.gz

Download URL pylossless-0.3.0.tar.gz
Size 49.9 MB
Tags Source
SHA-256 checksum
How to use checksums
311f74766296bcdda026bf576c6471bec18856d38009af29ac16779099cf8997
BLAKE2b-256 checksum
How to use checksums
126b73e08cfbb6d7a1e456886125e77deabf9b9d811731c82969b3d0bd50c2e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pylossless-0.3.0-py3-none-any.whl

Download URL pylossless-0.3.0-py3-none-any.whl
Size 49.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c54c25bbc99d642a5f9a03ca9dc9ed78232984f8f8253a6d5a441d7629603452
BLAKE2b-256 checksum
How to use checksums
784697ecd2fc01f42cf2caf5fd113bd5c5d6912764bb2a7dd6a0033cb95e04f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for pylossless 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pylossless-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page