Metadata-Version: 2.1
Name: ieeg
Version: 0.6.0
Summary: A Python package for iEEG data processing.
Home-page: https://github.com/coganlab/IEEG_Pipelines
Author: Aaron Earle-Richardson
Author-email: Aaron Earle-Richardson <ae166@duke.edu>, Raymond Xiong <raymond.xiong@duke.edu>
License: MIT License
        
        Copyright (c) 2023 coganlab
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/coganlab/IEEG_Pipelines
Project-URL: Source, https://github.com/coganlab/IEEG_Pipelines
Project-URL: Issues, https://github.com/coganlab/IEEG_Pipelines/Issues
Project-URL: Documentation, https://ieeg-pipelines.readthedocs.io/en/latest/
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bids>=0.0
Requires-Dist: mne
Requires-Dist: mne-bids>=0.16
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: scikit-learn
Requires-Dist: pandas
Requires-Dist: joblib>=1.3
Requires-Dist: psutil
Requires-Dist: pyvistaqt
Requires-Dist: pytz
Requires-Dist: pyqt5
Requires-Dist: tqdm
Requires-Dist: h5io
Requires-Dist: dipy
Requires-Dist: mne-qt-browser
Requires-Dist: edfio

# IEEG_Pipelines

A repo of current preprocessing pipelines for the [Cogan Lab](https://www.coganlab.org/)

[![Brain](./docs/images/brain_rot.gif)](https://www.coganlab.org/)

## Documentation

[![Documentation Status](https://readthedocs.org/projects/ieeg-pipelines/badge/?version=latest)](https://ieeg-pipelines.readthedocs.io/en/latest/?badge=latest)

[Lab Wiki](https://coganlab.pages.oit.duke.edu/wiki//)

## Pipeline Functionality

[![Python (3.10 - 3.13) on Windows/Linux/Mac](https://github.com/coganlab/IEEG_Pipelines/actions/workflows/Python-CI.yml/badge.svg)](https://github.com/coganlab/IEEG_Pipelines/actions/workflows/Python-CI.yml)

[![MATLAB latest](https://github.com/coganlab/IEEG_Pipelines/actions/workflows/MATLAB-CI.yml/badge.svg)](https://github.com/coganlab/IEEG_Pipelines/actions/workflows/MATLAB-CI.yml)

[![codecov](https://codecov.io/gh/coganlab/IEEG_Pipelines/branch/main/graph/badge.svg?token=X4IAFGOBGN)](https://codecov.io/gh/coganlab/IEEG_Pipelines)

## Installation

### MATLAB

1. Install MATLAB
2. Clone this repository into your userpath (`Documents/MATLAB` by default)
3. Run commands:

    ```MATLAB
    path = fullfile(userpath, 'IEEG_Pipelines', 'MATLAB');
    addpath(genpath(path));
    ```

### Python

Version 3.10 - 3.13 supported

#### Conda

1. Install Anaconda
2. Create an anaconda environment with python and pip packages installed
    
     ```bash
     conda create -n <YOUR_NAME> python<3.14 pip
     ```
3. Activate the environment

    ```bash
    conda activate <YOUR_NAME>
    ```
   
4. Run

    ```bash
    pip install ieeg
    ```

#### [Pip](https://pypi.org/project/ieeg/)

1. Install Python
2. Run:

    ```bash
    python -m venv <PATH TO VENV>/<YOUR_NAME>
    source activate <PATH TO VENV>/<YOUR_NAME>
    python -m pip install ieeg
    ```
   
## Usage

### MATLAB (INCOMPLETE)

1. Load `.dat` file using [convert_OpenE_rec2mat.m](MATLAB/ieeg%20file%20reading/convert_OpenE_rec2mat.m)
2. Create the ieeg data structure from the [ieegStructClass.m](MATLAB/ieegClassDefinition/ieegStructClass.m)
3. `TBD`

### Python ([INCOMPLETE](https://github.com/orgs/coganlab/projects/7))

1. Load BIDS files from BIDS directory using [`pybids`](https://bids-standard.github.io/pybids/)
    
    ```python
    from bids import BIDSLayout
    import ieeg
    layout = BIDSLayout(<BIDS_root>)
    data = ieeg.io.raw_from_layout(layout)
    ```
2. [Perform line noise filtering](https://ieeg-pipelines.readthedocs.io/en/latest/auto_examples/plot_clean.html)

3. [Check Spectrograms](https://ieeg-pipelines.readthedocs.io/en/latest/auto_examples/plot_spectrograms.html)

4. [Plot the high gamma responses](https://ieeg-pipelines.readthedocs.io/en/latest/auto_examples/plot_HG.html)

5. [Run the cluster correction and permutation test](https://ieeg-pipelines.readthedocs.io/en/latest/auto_examples/plot_stats.html)
