valosekj / fsleyes_preset

Run FSLeyes and automatically set display options
GNU General Public License v3.0
0 stars 0 forks source link

Run FSLeyes and automatically set display options

Jan Valosek, 2021 - 2024

Description

The script automatically set display options for FSLeyes viewer.

Current features

  1. Set display options (such as colormap, display range or opacity), e.g.:
fsleyes_preset.sh sub-01_T1w_seg.nii.gz
# starts FSLeyes will following options:
fsleyes sub-01_T1w_seg.nii.gz -cm red -a 50
  1. Set maximum intensity for structural images (such as T1w or T2w) to 70%, e.g.:
fsleyes_preset.sh sub-01_T1w.nii.gz
# starts FSLeyes will following options:
fsleyes sub-01_T1w.nii.gz -dr 0 <max * 0.7>
  1. Open all .nii and .nii.gz files from given directory and ignore all other files (such as json, yml, etc.), e.g.:
fsleyes_preset.sh *
# starts FSLeyes will following options:
fsleyes sub-01_T1w_seg.nii.gz -cm red -a 50 sub-01_T1w.nii.gz -dr 0 <max * 0.7>

Installation and usage

  1. Clone repo (e.g., into $HOME/code, or anywhere else):
git clone https://github.com/valosekj/fsleyes_preset.git
  1. Go into the cloned repo (by cd fsleyes_preset) and create a virtual environment there. Next, install requirements (manual here).

  2. Run the script (shell wrapper calls python script ):

fsleyes_preset.sh <image_1.nii.gz> ... <image_X.nii.gz>

Optional steps:

  1. Create an alias in your rc file (.bashrc or .zshrc) to start the script only by typing ff:
alias ff='$HOME/code/fsleyes_preset/fsleyes_preset.sh'
  1. Make the repo up to date:
git pull