From 6d277c12fef2f1d0361239993bbf208f00c7e34d Mon Sep 17 00:00:00 2001 From: Julian McGinnis Date: Wed, 10 Aug 2022 15:06:33 +0200 Subject: [PATCH 1/2] add wrapper script for fsl-based data orientation --- source/utility/reorient.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 source/utility/reorient.sh diff --git a/source/utility/reorient.sh b/source/utility/reorient.sh new file mode 100755 index 0000000..09bed5b --- /dev/null +++ b/source/utility/reorient.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Reorient sagittally scanned MRI images to axial orientation, complying to +# +# the stitching convention of the stitching algorithm by Ben Glocker. +# +# Usage: +# ./reorient.sh +# +# Authors: Julian McGinnis + +# Retrieve input params +SCAN=$1 + +# assemble name +SCAN_NAME=${SCAN%%.*} +FILE_ENDING="_axial_ornt.nii.gz" +FILE_PATH="$SCAN_NAME$FILE_ENDING" + +echo "Creating $FILE_PATH" + +# get starting time: +start=`date +%s` + +echo "Swaping Dimensions" +fslswapdim ${SCAN} LR AP IS ${FILE_PATH} +echo "Forcing neuological orientation" +fslorient -forceneurological ${FILE_PATH} + +# Display useful info for the log +end=`date +%s` +runtime=$((end-start)) +echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec" From 754aace058f8b597a427fb961dad0008c959e9a4 Mon Sep 17 00:00:00 2001 From: Julian McGinnis <33037028+jqmcginnis@users.noreply.github.com> Date: Thu, 11 Aug 2022 08:15:48 +0200 Subject: [PATCH 2/2] Update source/utility/reorient.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix typo Co-authored-by: Sandrine Bédard <71230552+sandrinebedard@users.noreply.github.com> --- source/utility/reorient.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utility/reorient.sh b/source/utility/reorient.sh index 09bed5b..bab5203 100755 --- a/source/utility/reorient.sh +++ b/source/utility/reorient.sh @@ -24,7 +24,7 @@ start=`date +%s` echo "Swaping Dimensions" fslswapdim ${SCAN} LR AP IS ${FILE_PATH} -echo "Forcing neuological orientation" +echo "Forcing neurological orientation" fslorient -forceneurological ${FILE_PATH} # Display useful info for the log