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
  • Running lead processes from the command line
  • Running exported jobs from the command line
  1. Appendix

Command line interface

PreviousVTA Calculation TroubleshootNextCommand line options

Last updated 3 years ago

Lead-DBS can now also be accessed from the command-line in the standalone version.

To run lead, open a terminal in the application folder of the standalone release and run the run_lead.sh script specifying the path to (currently v96). For example, in Mac:

./run_lead.sh /Applications/MATLAB/MATLAB_Runtime/v97

Running lead processes from the command line

It is also possible to execute a process without the lead GUI by specifying further options. For example, in order to run coregistration and normalization using the Segment algorithm:

./run_lead.sh /Applications/MATLAB/MATLAB_Runtime/v97 dbs -coreg_checkbox -normalize_checkbox -normmethod 2 /path/to/patient/dir

Where path/to/patient/dir is the directory of the patient. Multiple patients can be processed by entering all their directories.

Command line options are defined the same way as the handles name in the GUI. It is possible to query them opening the lead_dbs.fig in GUIDE and clicking the desired component. A non extensive list of options is also listed in the page.

Using the -process option the basic Lead-DBS pipeline is executed: coregistration, normalization, brain shift correction and electrode reconstruction (PaCER). For example:

./run_lead.sh /Applications/MATLAB/MATLAB_Runtime/v97 dbs -process /path/to/patient/dir

When using the -process option it is also possible to specify subject directory(s). In this case the subject images will be processed in a derivates (Lead_DBS-like) folder. If a BIDS root directory is set, then all of its subjects will be processed.

Running exported jobs from the command line

Exported jobs created with the Export Code button can be run from the command line using the execute command and specifying the file location:

./run_lead.sh /Applications/MATLAB/MATLAB_Runtime/v97 execute /path/to/lead_job.json

It's important to remark that the file is in .json format. This option must be set in the exporting code dialog:

Finally, it is also possible to edit this .json file with a text editor and run the desired processes (without the need to specify every option as in the previous section).

Matlab Runtime
Command line options
BIDS