-
Notifications
You must be signed in to change notification settings - Fork 0
/
slice_warp.bash
executable file
·33 lines (29 loc) · 1.22 KB
/
slice_warp.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# osascript saved as app, put in dock:
# tell application "Terminal" to do script "/opt/ni_tools/slice_warp_gui/slice_warp.bash; exit"
#
# use brew python and other tools
PATH="/usr/local/bin:$PATH"
# add slice gui to path
PATH="$PATH:/opt/ni_tools/slice_warp_gui"
# add dcm2niix to the path
PATH="$PATH:/opt/ni_tools/dcm2niix"
# ROBEX
PATH="$PATH:/opt/ni_tools/robex_1.12"
# MATLAB
PATH="$PATH:/Applications/MATLAB_R2017a.app/bin"
AFNIDIR="/opt/ni_tools/afni"
PATH="$PATH:$AFNIDIR"
# mount data if we dont have it
#[ ! -d /Volumes/Disk_C/Temp/ ] && echo "mounting temp!" && osascript -e "try" -e "mount volume \"smb://[email protected]/Disk_C\"" -e "end try"
vialinux=""
viascanner=""
[ -d /Volumes/HostDicom/ ] && mount | grep HostDicom -q && vialinux=yes
[ -d /Volumes/Disk_C/ ] && mount | grep Disk_C -q && viascanner=yes
if [ -z "$viascanner$vialinux" ]; then
ret=$(osascript -e 'tell application (path to frontmost application as text) to display dialog "MR computer is not accessible! [email protected]/HostDicom or .../Disck_C with finder (go->connect to server)" buttons {"Continue","Quit"} with icon caution')
[[ $ret =~ Quit ]] && exit 1
fi
# Launch our program if we dont have it open
slice_warp.py