/DiODE_python

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Contributors Forks Stargazers Issues MIT License

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgements

About The Project

These python scripts replicate the Matlab implementation developed by Till Dembek in a program name DiODe. The original code can be found here.

Information about the algorithm can be found here.

Not for commercial use! Only fully validated for Boston Scientific directional leads.

Built With

  • Python version: 3.9

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. In a terminal, clone the repo by running:

    git clone https://github.com/greydongilmore/DiODE_python.git
  2. Change into the project directory (update path to reflect where you stored this project directory):

    cd /home/user/Documents/Github/DiODE_python
  3. Install the required Python packages:

    python3 -m pip install -r requirements.txt

Usage

  1. In a terminal, move into the project directory

    cd /home/user/Documents/Github/DiODE_python
  2. Run the following to execute the epoch script:

    python3 main.py -i "full/path/to/nifti_file" -e 'electrode_name' -rh -14.95,24.64,52.19 -rt -21.24,8.84,72.19 -lh 5.43,25.12,52.28 -lt 15.08,12.11,71.03

    or

    python3 main.py -i "full/path/to/nifti_file" -e 'electrode_name' -fcsv 'full/path/to/fcsv_coords'
  • -i: full directory path to the postoperative CT scan with electrodes (in nii.gz)
  • -e: the name of the electrode model (for acceptable electrodes see diode_elspec.py)
  • -rh/-lh: the right/left RAS coordinates for the bottom of the most distal contact
  • -rh/-lh: the right/left RAS coordinates for another point along the electrode
  • -fcsv: optionally, you can provide an fcsv file containing the coordinates (these files are generated in 3D Slicer where it might be easier to identify the required coordinates and store them as a Markups file in 3D Slicer)

Repository Structure

The repository has the following scheme:

├── README.md
├── LICENSE
├── requirements.txt            # python libraries required to run these scripts
├── data
   ├── *nii.gz                 # sample CT images containing B.Sci directional electrodes
|   ├── *fcsv                   # associated RAS coordinates for the head/tail of each electrode
|   └── imgs                    # default output colder for generated figures
├── main.py                    # potentially cleaned-up version
├── diode_auto.py               # first pass conversion from Matlab (less efficient but still runs)
├── read_fcsv.m                 # Matlab function to read fcsv files, could be used in the Matlab implementation
├── diode_elspec.py             # electrode specification `.py` that writes the JSON file (can use this to add additional electrodes)
└── diode_elspec.json           # electrode specifications for the accepted electrode models
    

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU License. See LICENSEfor more information.

Contact

IP and any questions: Till Dembek - @DembekTill - till.dembek@uk-koeln.de

Conversion to Python: Greydon Gilmore - @GilmoreGreydon - greydon.gilmore@gmail.com

Acknowledgements

Publications