Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
winpack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
winpack
Commits
beda119d
Commit
beda119d
authored
5 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
OpenScience master script v1.0
parent
e3e149b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
OpenScience.sh
+87
-0
87 additions, 0 deletions
OpenScience.sh
with
87 additions
and
0 deletions
OpenScience.sh
0 → 100755
+
87
−
0
View file @
beda119d
#!/bin/bash -e
#################### WIN OpenScience Wrapper version 6.0.1 ##############
#########################################################################
### This script expects to be run in a directory where the user has
### read-write access, all files generated by this script will be
### created in that directory.
#################### Standard set-up functions ##########################
DEFAULTDIR
=
`
pwd
`
#### Usage
function
usage
{
echo
"
$0
: [-d] [-f] [-o]"
echo
"OpenScience wrapped version of an analysis."
echo
"-d <directory>: Use existing data in <directory> instead of downloading"
echo
"-f <directory>: Use existing FSL in <directory> instead of downloading"
echo
"-o <directory>: Output to <directory> instead of current directory"
echo
""
}
##### FSL - Download
function
downloadFSL
{
echo
"Installing FSL via internet"
curl
-s
https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py
>
fslinstaller.py
chmod
u+x fslinstaller.py
./fslinstaller.py
-V
6.0.1
-q
-p
-d
$1
}
##### FSL - Setup
function
setupFSL
{
echo
"Setting up FSL"
if
[
$#
-eq
0
]
;
then
NEWFSLDIR
=
${
DEFAULTDIR
}
/fsl
downloadFSL
${
NEWFSLDIR
}
else
NEWFSLDIR
=
$1
fi
if
[
!
-z
"
${
FSLDIR
}
"
]
;
then
PATH
=
${
PATH
/
$FSLDIR
/
}
fi
export
FSLDIR
=
${
NEWFSLDIR
}
export
PATH
=
${
FSLDIR
}
/bin:
${
PATH
}
.
${
FSLDIR
}
/etc/fslconf/fsl.sh
}
##### Data - Setup
function
setupData
{
echo
"Setting up data"
if
[
$#
-gt
1
]
;
then
DATADIR
=
$2
return
fi
echo
"Downloading data via internet"
curl
-s
$1
|
tar
-zxf
-
DATADIR
=
${
DEFAULTDIR
}
}
#################### Standard OpenScience entrypoint ####################
OUTPUTDIR
=
${
DEFAULTDIR
}
unset
existingFSLDIR
unset
existingDATADIR
while
getopts
"f:d:o:"
Option
do
case
$Option
in
d
)
existingDATADIR
=
$OPTARG
;;
f
)
existingFSLDIR
=
$OPTARG
;;
o
)
OUTPUTDIR
=
$OPTARG
;;
*
)
usage
exit
1
;;
esac
done
#################### Analysis-specific URL ############################
DATAURL
=
'https://users.fmrib.ox.ac.uk/~mwebster/data2.tar.gz'
#################### Setup Environment ################################
setupFSL
${
existingFSLDIR
}
setupData
${
DATAURL
}
${
existingDATADIR
}
#################### Start of data processing #########################
echo
"Starting analysis"
echo
"with FSLDIR:
${
FSLDIR
}
DATADIR:
${
DATADIR
}
OUTPUTDIR:
${
OUTPUTDIR
}
"
#################### Analysis-specific commands #######################
${
FSLDIR
}
/bin/bet
${
DATADIR
}
/structural
${
OUTPUTDIR
}
/structural_brain
-f
0.5
-g
0
-m
-s
${
DATADIR
}
/scripts/myScript.sh
${
OUTPUTDIR
}
/structural_brain
>
myOutput.txt
#################### End of Analysis ##################################
echo
"Done"
#################### End of data processing ###########################
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment