Commit e749f014 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

software: ashs chunk script

parent 35c5fa45
......@@ -76,38 +76,31 @@ position. Subsequent runs of this script will submit chunksize number of new
#!/bin/bash
# This script will submit ASHS jobs in small chunks. To submit a next chunk
# just run this script again, it will pick up the current chunk state from a
# file called "chunknumber" in the current directory and increment it.
if [ -f chunknumber ] ; then
chunknumber=$(cat chunknumber)
chunknumber=$((chunknumber+1))
else
chunknumber=0
fi
echo $chunknumber > chunknumber
echo -e "Running chunk: $chunknumber\n"
pfad='/home/mpib/kuehn/BASE/'
cd $pfad
# just run this script again. The state is inferred from the existence of the
# working directory only.
# somewhat safe value for concurrent ashs run at the moment
imagesperchunk=30
# this will only run the first N images
for subject in $( ls {CO,DA,SP,TS}*.nii | tail -n+$((chunknumber*imagesperchunk+1)) | head -n$imagesperchunk ) ; do
echo "Starting script for subject: $subject in chunk $chunknumber"
submitted=0
for subject in $( ls -1 *nii) ; do
if [ $submitted -ge $imagesperchunk ] ; then
echo "Submitted $imagesperchunk images, done for now."
exit 0
fi
name=${subject%%\.img}
wdir=workdir_${name}_dir
if [ -d $wdir ] ; then
echo "Skipping $subject , working directory exists."
echo "Skipping $subject, working directory exists."
continue
fi
submitted=$(( submitted + 1 ))
echo "Starting script for subject: $subject"
ASHS_ROOT=/opt/ashs /opt/ashs/bin/ashs_main.sh \
-a /opt/ashs/data/atlas_paul/ \
-g /home/mpib/kuehn/BASE/T1/T1_${subject} \
-g T1/t1_${subject} \
-f ${subject} \
-w $wdir \
-T \
......@@ -116,6 +109,9 @@ position. Subsequent runs of this script will submit chunksize number of new
sleep 2s
done
echo "No images left, exiting."
exit 0
Atlas Creation
--------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment