Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #121 from PennBBL/v0.7.0
Browse files Browse the repository at this point in the history
v0.6.1
  • Loading branch information
rciric committed Aug 3, 2018
2 parents af1264b + f5882ea commit f4c8aef
Show file tree
Hide file tree
Showing 18 changed files with 693 additions and 70 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Penn BBL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions atlas/coor/MNI.sclib
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPACE::MNI%1x1x1
:#ROIName#X,Y,Z#radius
#PCC8#0,-46,34#8
12 changes: 12 additions & 0 deletions core/CONSOLE_MODULE_G
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@



###################################################################
# · · · · · · · · · · · · · · · · · · · · · #
# #
# ·$(${XCPEDIR}/core/padAndCentreString 59 ${mod_name})· #
# #
# · · · · · · · · · · · · · · · · · · · · · #
###################################################################


140 changes: 140 additions & 0 deletions core/Ingress
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#!/usr/bin/env bash

###################################################################
# ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ ☭ #
###################################################################

###################################################################
# PARSER FOR THE INGRESS SYSTEM
#------------------------------------------------------------------
# The pipeline's ingress system maps high-level user-defined
# ingress variables to the standard variables used by the
# processing system using ingress mappings (.ing files).
###################################################################
unset ing

###################################################################
# 1. Read the .ing file
###################################################################
mapfile ing < ${XCPEDIR}/core/ingress/${var//\[$sub\]}.ing

###################################################################
# 2. Verify that the specified variable for ingress exists.
###################################################################
if [[ ! -s ${!var} ]]
then
################################################################
# If it doesn't exist, check for a compressed version and
# prepare to extract it.
#
# The following code block handles the case of the input
# directory being provided as a compressed tar archive. It's
# currently reliant on some non-builtins.
################################################################
var_tar=${!var}.tar.gz
var_tgt=${!var}-extract
if [[ -s ${var_tar} ]]
then
mkdir -p ${var_tgt}
tar -zxvf ${var_tar} -C ${var_tgt} >/dev/null
#############################################################
# This convoluted code is here in case the input is
# compressed as a subdirectory of the provided tar
#############################################################
i=(${ing[1]})
i[1]=${i[1]//'%ING'/${!var}}
i[1]=${i[1]//'%INT'/'*'}
try=( $(find ${var_tgt} -name ${i[1]}) )
var_untar=$( dirname $(abspath ${try[0]}))
rm -f ${var_tar}
mv -f ${var_untar} ${!var}
rm -rf ${var_tgt}
################################################################
# Sometimes, it just doesn't exist. Abort the stream if this
# happens.
################################################################
else
abort_stream "Invalid path provided for ${var}"
fi
fi

###################################################################
# 3. Iterate through the mapping rules for the specified variable.
###################################################################
for i in ${!ing[@]}
do
i=(${ing[i]})
i[1]=${i[1]//'%ING'/${!var}}

case ${i[0]} in
################################################################
# Metadata import: spatial
################################################################
%SPACE)
import_metadata ${i[1]} to ${spaces[sub]}
;;

################################################################
# Metadata import: derivatives
################################################################
%DERIV)
import_metadata ${i[1]} to ${aux_imgs[sub]}
;;

################################################################
# Metadata import: atlas
################################################################
%ATLAS)
import_metadata ${i[1]} to ${atlas[sub]}
;;

################################################################
# Define variable
################################################################
*)
#############################################################
# Substitutions
# %INT replaced by all matched integers in order
#############################################################
if contains ${i[1]} '%INT'
then
unset i_buffer
j=0
while (( 1 == 1 ))
do
x=$(abspath ${i[1]//'%INT'/${j}})
if [[ -n ${x} ]]
then
i_buffer="${i_buffer} ${x}"
else
break
fi
(( j++ ))
done
i[1]=${i_buffer}
fi

#############################################################
# %OR indicates to try a series of possibilities until one
# is matched successfully
#############################################################

[[ -z ${i_buffer} ]] && i[1]=$(abspath ${i[1]})
#############################################################
# Determine whether the variable should be written to the
# design file. ('!' at the beginning of the variable's name
# indicates that it's for temporary use only.)
#############################################################
if ! contains ${i[0]} '^\!'
then
assign i[1] as ${i[0]}[sub]
blog=${i[0]}[$sub]
cohort_vars+=(${i[0]}[$sub])
else
i[0]=${i[0]#'!'}
assign i[1] as ${i[0]}
fi
;;

esac
done
2 changes: 1 addition & 1 deletion core/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xcpEngine-v0.6.0-accelerator-prerelease
xcpEngine-v0.7.0-prerelease
5 changes: 1 addition & 4 deletions core/config/anat.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ menu() {


###################################################################
# Confound model selection
# Processing stream selection
###################################################################
menu_process() {

Expand Down Expand Up @@ -221,9 +221,6 @@ anat_design_build() {
local exp
local REPLY
local response

local prepstream1
local prepstream2=-DMT

case ${anat[stream]} in

Expand Down

0 comments on commit f4c8aef

Please sign in to comment.