Lead-DBS User Guide
  • Introduction
  • How to contribute to Lead-DBS
  • Installation
  • Lead-DBS
    • Overview
    • Self-Tutoring with Lead-Tutor
    • 1. Load Patient Folder
      • Importing a classic Lead-DBS dataset to BIDS version
    • 2. Image Import
      • Converting NIfTI-images into BIDS
      • Converting DICOM files into BIDS
    • 3. Volume Registrations
      • Coregister Volumes
      • Normalizing the Images
      • Brainshift Correction
      • Checking the Coregistration and Normalization
    • 4. (optional) Surface Reconstruction
    • 5. (optional) Reconstruction of Electrode Trajectories
      • Orientation of Directional Leads
        • Prerequisites
        • Automatic Algorithm
        • Possible Problems with the Automatic Algorithm
        • User-Assisted Algorithm (Manual Refine)
      • TRAC/CORE Details
      • Manual Reconstruction
      • Reconstruction File
    • 6. (optional) Perform Connectivity Analysis
    • 7. Visualization
      • MER Analysis
    • Reconstruction Statistics
  • Lead-Group
    • Group analyses with Lead-DBS
    • Setup Analysis
    • General Settings
    • Group Visualization
    • Calculate VTA and Stats
    • Sweetspot Explorer
  • Connectomics
    • Connectomics
      • Diffusion MRI: Patient Specific Processing
      • fMRI-Analysis: Patient Specific Processing
      • Using Normative Connectomes
      • Network Mapping Explorer
      • Fiber Filtering Explorer
    • Lead Connectome Mapper
  • Lead-OR
    • Imaging setup
    • Electrophysiology setup
    • Using the platform
  • Appendix
    • Code Backbone
    • Acquiring and Installing Atlases
      • Customizing Atlas Visualization
    • Troubleshooting / Specific Help
      • Adding Fortran dependencies for VTA modeling
      • VTA Calculation Troubleshoot
    • Command line interface
      • Command line options
    • Matlab scripting examples
      • Installing an atlas from an online repository
      • Warping a normative connectome to native subject space
    • Using Slicer
      • Sweet-sour spot
Powered by GitBook
On this page
  • Prerequisite
  • Normal installation
  • Installation via GitHub
  • Installing additional content
  • Update Lead-DBS
  • Troubleshooting
  • Disclaimer
  • Useful tools

Installation

PreviousHow to contribute to Lead-DBSNextOverview

Last updated 7 months ago

Prerequisite

  • Recommended RAM size: 32GB or more

  • MATLAB: R2022b or later

  • MATLAB Image Processing Toolbox

  • MATLAB Signal Processing Toolbox

  • MATLAB Statistics and Machine Learning Toolbox

  • MATLAB Curve Fitting Toolbox (optional)

  • MATLAB Parallel Computing Toolbox (optional)

Normal installation

  1. Download Lead-DBS from .

  2. Extract the downloaded zip into your MATLAB toolbox folder. For example, it can be in your home folder under Documents/MATLAB/toolbox. Please avoid extracting Lead-DBS into MATLAB installation folder or other folder which requires sudo or administrator permission. An installation directory path with spaces should also be avoided.

  3. Add SPM12 in your MATLAB search path: right-click on the SPM12 folder and choose Add to Path -> Selected Folders (NOT Selected Folders and Subfolders).

  4. Add Lead-DBS in your MATLAB search path: right-click on the Lead-DBS folder and choose Add to Path -> Selected Folders and Subfolders .

Once Lead-DBS is added to your MATLAB search path, you can start it by running lead dbs in MATLAB Command Window.

Installation via GitHub

For more experienced users or developers who'd also wish to modify the code and potentially improve Lead-DBS, there is an alternative way of installation:

  1. Add SPM12 in your MATLAB search path: right-click on the SPM12 folder and choose Add to Path -> Selected Folders (NOT Selected Folders and Subfolders).

  2. Add Lead-DBS in your MATLAB search path: right-click on the Lead-DBS folder, choose Add to Path -> Selected Folders (NOT Selected Folders and Subfolders) and then run ea_setpath in MATLAB Command Window to set the path.

This alternative way of installation can also make it easy to receive quicker (most often daily) hotfixes or updates and helps us to assist you in a more flexible way.

We'd love to implement your improvements into Lead-DBS – feel free to submit pull requests or contact us for direct push access.

Installing additional content

Several add-ons are available which can be installed manually from inside Lead-DBS. For most cases, Lead-DBS will try to auto-install these when needed. You can also take a look at the Install menu within the main Lead-DBS GUI to install custom items.

Update Lead-DBS

  • If you have a normal installation of Lead-DBS, you can use the menu Install -> Install development version of Lead-DBS. It will download and apply the latest hotfix before a new release is available.

  • If you have Lead-DBS installed via GitHub, simply pull from GitHub (in the terminal or any Git client you prefer).

Troubleshooting

If you have used previous versions of Lead-DBS, but encounter errors when running a new version, you can run ea_restoreprefs(1,1) in MATLAB Command Window to reset the preferences and try again.

If Lead-DBS subfolders are somehow not completely added to MATLAB search path (in such case you may see Unrecognized function or variable error), you can run ea_setpath in MATLAB Command Window to update the search path.

On macOS, Lead-DBS version < 3.0 and the classic branch on GitHub only support MATLAB version <= R2023a.

If you encounter permission issue when running Lead-DBS on macOS, can run ea_clear_xattr to fix it.

Disclaimer

Useful tools

Clone (NOT download) the Lead-DBS repository from and switch to develop branch.

Download the necessary and unzip it into the cloned git repository.

If you have the GitHub installation of Lead-DBS and need to switch between the develop branch and the classic branch, you must also download the and unzip it into the Lead-DBS installation folder. To switch branches, you can utilize the MATLAB helper functionsea_switch2classic and ea_switch2dev (ensure is installed on your system. While it often comes preinstalled on Linux and macOS, Windows users typically need to install it manually). This will ensure that the prefs and recent histories for both branches are preserved correctly.

We try to maintain compatibility to Linux, masOS and Windows, but given our small team, not all functions are well tested on all OSs ().

DICOM viewer

NIfTI viewer ,

(macOS)

SPM12
here
here
data
classic data
Git
fork us on GitHub and join our team to improve that
Aliza
MRIcron
Mango
DTI-TK Quicklook plugin
3D Slicer
FSL
DSI-Studio
TrackVis