Skip to content
Snippets Groups Projects
Commit 5d22bd7d authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Updated script to work with C++ code

parent cf8176cf
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# basic image handling scripts # data format conversion script (between various nifti and Analyze flavours)
# #
# Mark Jenkinson # Mark Jenkinson
# FMRIB Image Analysis Group # FMRIB Image Analysis Group
# #
# Copyright (C) 1999-2004 University of Oxford # Copyright (C) 1999-2008 University of Oxford
# #
# SHCOPYRIGHT # SHCOPYRIGHT
...@@ -19,10 +19,6 @@ if [ $# -lt 2 ] ; then ...@@ -19,10 +19,6 @@ if [ $# -lt 2 ] ; then
fi fi
storedval=$FSLOUTPUTTYPE
FSLOUTPUTTYPE=$1
export FSLOUTPUTTYPE
oldfile=`$FSLDIR/bin/remove_ext $2` oldfile=`$FSLDIR/bin/remove_ext $2`
if [ $# -ge 3 ] ; then if [ $# -ge 3 ] ; then
...@@ -33,19 +29,8 @@ else ...@@ -33,19 +29,8 @@ else
inplace=1 inplace=1
fi fi
# determine if it is a complex image or not
iscomplex=0;
dtype=`$FSLDIR/bin/fslval $oldfile datatype`;
if [ X$dtype = X32 ] ; then iscomplex=1; fi
if [ X$dtype = X1792 ] ; then iscomplex=1; fi
if [ X$dtype = X2048 ] ; then iscomplex=1; fi
# do the copy / type conversion # do the copy / type conversion
if [ $iscomplex = 1 ] ; then $FSLDIR/bin/fslchfiletype_exe $1 $oldfile $newfile
$FSLDIR/bin/fslcomplex -copyonly $oldfile $newfile
else
$FSLDIR/bin/fslmaths $oldfile $newfile
fi
# for inplace stuff remove and copy old one # for inplace stuff remove and copy old one
# exact mechanism is to be careful not to remove old IF a new one isn't writable in this place (eg over quota) # exact mechanism is to be careful not to remove old IF a new one isn't writable in this place (eg over quota)
...@@ -59,6 +44,3 @@ if [ $inplace = 1 ] ; then ...@@ -59,6 +44,3 @@ if [ $inplace = 1 ] ; then
fi fi
fi fi
FSLOUTPUTTYPE=$storedval
export FSLOUTPUTTYPE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment