Skip to content
BrainlifeMEEGPublic

About

Crop raw data between two time points.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Crop Raw MEG/EEG Data

Run on Brainlife.io

Description

This Brainlife.io application crops raw MEG/EEG data to a specified time window. It takes a raw MNE-format data file and trims it to the interval [tmin, tmax] using MNE-Python's raw.crop() function.

The app generates:

  • Cropped data in MNE-Python format

Inputs

  • mne (neuro/meeg/mne/raw): continuous raw MEG/EEG data to crop (required)

Outputs

  • out_dir/raw.fif (neuro/meeg/mne/raw): cropped MEG/EEG data

Configuration Parameters

key type default description
tmin float | null null Start time in seconds for cropping (must be >= 0). If null, the data are kept from the beginning of the recording.
tmax float | null null End time in seconds for cropping (cannot exceed data duration). If null, the data are kept until the end of the recording.

Usage

Running on Brainlife.io

  1. Upload your MEG/EEG data file in MNE format (.fif)
  2. Select the crop-raw app
  3. Configure the time window:
    • Set tmin to the desired start time in seconds (or leave null for start of recording)
    • Set tmax to the desired end time in seconds (or leave null for end of recording)
  4. Submit the task

Local Testing

# Update config.json with your data path and desired tmin/tmax
# Then run:
python main.py

Technical Details

Cropping Implementation

  • Uses MNE-Python's raw.crop(tmin, tmax) method
  • tmin=null defaults to the start of the recording (t=0)
  • tmax=null defaults to the end of the recording
  • Times are specified in seconds relative to the recording start
  • The crop is applied in-place after loading (data is preloaded for efficiency)

Authors

Citations

Funding Acknowledgement

brainlife.io is publicly funded. We kindly ask that you acknowledge the funding below in your code and publications.

NSF-BCS-1734853 NSF-BCS-1636893 NSF-ACI-1916518 NSF-IIS-1912270 NIH-NIBIB-R01EB029272 NIH-NIBIB-R01EB030896

License

Copyright (c) 2026 MEEG Brainlife team. Licensed under AGPL-3.0, see license.txt.

About

Crop raw data between two time points.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages