-
Notifications
You must be signed in to change notification settings - Fork 6
/
Ironsmith_fsleyes
executable file
·140 lines (107 loc) · 3.92 KB
/
Ironsmith_fsleyes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
set -e #Exit on error
#Authored by Valentinos Zachariou on 06/22/2021
#
# Copyright (C) 2022 Valentinos Zachariou, University of Kentucky (see LICENSE file for more details)
#
# Script launches fsleyes from within the singularity container.
# Useful for people who do not have a viewer program
# and want to visualise the Ironsmith outputs.
#
#
#
#
# _---~~(~~-_.
# _{ ) )
# , ) -~~- ( ,-' )_
# ( `-,_..`., )-- '_,)
# ( ` _) ( -~( -_ `, }
# (_- _ ~_-~~~~`, ,' )
# `~ -^( __;-,((()))
# ~~~~ {_ -_(())
# `\ }
# { }
#
#
Path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Path where Ironsmith_AFNI is situated
PathCurr=`pwd` #Folder where Ironsmith_AFNI was executed from
echo ""
echo "---------------------------------------------------------------"
echo "*** Checking if Singularity and/or Docker are installed: ***"
echo "---------------------------------------------------------------"
echo ""
#Check for Singularity or docker
if command -v singularity &> /dev/null; then
SingVer2=$(singularity --version | awk -F 'version' '{print $2}')
echo ""
echo "Singularity Ver$SingVer2 installed. All good! "
echo ""
#Test QSM_Container.simg
echo ""
echo "---------------------------------------------------------------"
echo "*** Testing QSM_Container.simg... ***"
echo "---------------------------------------------------------------"
echo ""
if [ -f "$Path/Functions/QSM_Container.simg" ] && [[ $(find $Path/Functions/QSM_Container.simg -type f -size +10750000000c 2>/dev/null) ]]; then
echo ""
echo "QSM_Container.simg FOUND in $Path/Functions"
echo ""
else
echo ""
echo -e "\e[31m----------------------------------------------"
echo "ERROR: QSM_Container.simg NOT FOUND in $Path/Functions or is the wrong size (should be 10.8G)! (⊙_◎) "
echo ""
echo "Please download QSM_Container.simg from:"
echo ""
echo "https://drive.google.com/file/d/1NFV2z0yIEPKGblQVrcMe8bza8ZS21AO7/view?usp=sharing"
echo ""
echo "Then place in $Path/Functions"
echo -e "----------------------------------------------\e[0m"
echo ""
exit
fi
#Warmup run
singularity run -e $Path/Functions/QSM_Container.simg flirt -version &> /dev/null
unset ConTest
ConTest=$(singularity run -e $Path/Functions/QSM_Container.simg flirt -version)
if [[ $ConTest == "FLIRT version 6.0" ]]; then
echo ""
echo "QSM_Container.simg test SUCCESSFUL! "
echo ""
else
echo ""
echo -e "\e[93m----------------------------------------------"
echo "ERROR: QSM_Container.simg test FAILED! "
echo ""
echo "QSM_Container.simg could be corrupted, please re-download from:"
echo "https://drive.google.com/file/d/1NFV2z0yIEPKGblQVrcMe8bza8ZS21AO7/view?usp=sharing"
echo -e "----------------------------------------------\e[0m"
echo ""
exit
fi
elif ! command -v singularity &> /dev/null; then
echo ""
echo -e "\e[93m----------------------------------------------"
echo "WARNING: Singularity NOT FOUND! "
echo "Checking for DOCKER"
echo -e "----------------------------------------------\e[0m"
echo ""
if command -v docker &> /dev/null; then
DockVer2=$(docker --version | awk -F 'version' '{print $2}')
echo ""
echo -e "\e[93m----------------------------------------------"
echo "ERROR: Docker Ver $DockVer2 installed. However, only Singularity supported at the moment (╯°□°)╯︵ ┻━┻ "
echo -e "----------------------------------------------\e[0m"
echo ""
exit
elif ! command -v docker &> /dev/null; then
echo ""
echo -e "\e[93m----------------------------------------------"
echo "ERROR: Singularity not FOUND! "
echo "Singularity needs to be installed for this toolkit to work ¯\_(ツ)_/¯"
echo -e "----------------------------------------------\e[0m"
echo ""
exit
fi
fi
singularity exec --bind $PathCurr $Path/Functions/QSM_Container.simg fsleyes