Skip to content
Browse files

new file: rsc/scripts/fslreorient2std.sh

 	modified:   rsc/scripts/main.sh
  • Loading branch information...
1 parent 7e7d5ce commit 106f5cdadcca70d85a2a6870711e1fa95d0e9efe @ahheckel committed Oct 14, 2012
Showing with 12 additions and 5 deletions.
  1. +10 −0 rsc/scripts/fslreorient2std.sh
  2. +2 −5 rsc/scripts/main.sh
View
10 rsc/scripts/fslreorient2std.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# This is a wrapper for fslreorient2std (FSL v.5) to ensure compatibility with version 4.1.9.
+set -e
+
+input=$(remove_ext "$1")
+output=$(remove_ext "$2")
+
+fslreorient2std $input $output
+
+if [ -f ${output}.nii ] ; then fslmaths $output $output ; rm ${output}.nii ; fi
View
7 rsc/scripts/main.sh
@@ -465,8 +465,7 @@ if [ $RECON_STG1 -eq 1 ] ; then
# reorient to please fslview
file=`ls ${srcdir}/${subj}/${sess}/${pttrn_strucs} | tail -n 1` # take last, check pattern (!)
echo "RECON : subj $subj , sess $sess : reorienting T1 ('$file') to please fslview..."
- rm -f $fldr/tmp_t1.nii $fldr/tmp_t1.nii.gz
- fslreorient2std $file $fldr/tmp_t1 ; fslmaths $fldr/tmp_t1 $fldr/tmp_t1 ; rm -f $fldr/tmp_t1.nii
+ $scriptdir/fslreorient2std.sh $file $fldr/tmp_t1
# convert to .mgz
echo "RECON : subj $subj , sess $sess : converting T1 to .mgz format..."
@@ -1787,9 +1786,7 @@ if [ $VBM_STG1 -eq 1 ] ; then
fslmaths $file ${fldr}/$(subjsess)_t1_orig
# reorient for fslview
- rm -f ${fldr}/$(subjsess)_t1_reor.nii ${fldr}/$(subjsess)_t1_reor.nii.gz
- fslreorient2std $file ${fldr}/$(subjsess)_t1_reor
- fslmaths ${fldr}/$(subjsess)_t1_reor ${fldr}/$(subjsess)_t1_reor ; rm -f ${fldr}/$(subjsess)_t1_reor.nii
+ $scriptdir/fslreorient2std.sh $file ${fldr}/$(subjsess)_t1_reor
ln -sf $(subjsess)_t1_reor.nii.gz $fldr/$(subjsess)_t1_struc.nii.gz
# convert to .mnc & perform non-uniformity correction

0 comments on commit 106f5cd

Please sign in to comment.
Something went wrong with that request. Please try again.