-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sct-pipeline/jqm/nifti_debugging
add wrapper script for fsl-based data orientation
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <SCAN> | ||
# | ||
# 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 neurological 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" |