-
Notifications
You must be signed in to change notification settings - Fork 1
/
spm12Batch_CheckInstall
executable file
·103 lines (81 loc) · 2.1 KB
/
spm12Batch_CheckInstall
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
#!/bin/bash
# # # # # # # # # # # # # # # # # #
#
# Run this command to check if the install is okay
#
# This is a brief check, best is to run the
# preprocessing example for TestSubject.
#
# e.g. spm12Batch_CheckInstall
#
#
# Robert C. Welsh
# Copyright 2005-2021
#
# spm12Batch_CheckInstall
#
# # # # # # # # # # # # # # # # # #
#
# Main spm23Batch function.
#
VERSION="1.0"
VERSIONDATE="2021-04-12"
# Find out where the current command lives and execute some common code.
theFullCommand="$0 $*"
execDIR=`pwd`
# Find out where the current command lives and execute some common code.
theCommand=`which $0`
thisDir=`dirname $theCommand`
thisCommand=`echo $theCommand | awk -F/ '{print $NF}'`
# This piece of code all of the spm12Batch scripts will use
. ${thisDir}/auxiliary/commonCode_AllScriptsStart
# We only will print out the help and ignore everything!
#. ${thisDir}/auxiliary/help/${thisCommand}_Help
# Check for directories.
PROB=0
SPM12BATCHOK="spm12Batch and necessary elements appear all okay."
for ITEM in ${SPM12B1} ${SPM12B3}
do
if [ ! -d ${ITEM} ]
then
echo "Element missing : ${ITEM}"
SPM12BATCHOK="spm12Batch and necessary elements appear to have a problem."
PROB=1
fi
done
# Check for executables.
for ITEM in ${MATLAB} 3dDespike fslorient animaDistortionCorrection antsRegistration
do
THERE=`which ${ITEM}`
if [ -z "${THERE}" ]
then
echo "Element missing : ${ITEM}"
SPM12BATCHOK="spm12Batch and necessary elements appear to have a problem."
PROB=$(( ${PROB} + 1 ))
fi
done
# Check the the MICCAI is there
ANTSdir=`which antsRegistration`
if [ ! -z "${ANTSdir}" ]
then
ANTSdir=`dirname ${ANTSdir}`
if [ ! -d ${ANTSdir}/../Templates/MICCAI2012-Multi-Atlas-Challenge-Data ]
then
echo
echo "Missing MICCAI templates for ANTs, see Installation instructions for the Administrator."
if [ ${PROB} -eq 0 ]
then
SPM12BATCHOK="spm12Batch and binaries are okay, but see the issue above."
fi
fi
else
echo
echo "Missing ANTs"
fi
echo
echo ${SPM12BATCHOK}
echo
exit 0
#
# all done.
#