Skip to content
Snippets Groups Projects
Commit fa939443 authored by Matthew Webster's avatar Matthew Webster
Browse files

whirlgif

parent 12f34e9a
No related branches found
No related tags found
No related merge requests found
...@@ -56,12 +56,12 @@ $FSLDIR/bin/avwsplit $im ...@@ -56,12 +56,12 @@ $FSLDIR/bin/avwsplit $im
for fnm in `$FSLDIR/bin/imglob vol*` ; do for fnm in `$FSLDIR/bin/imglob vol*` ; do
num=`$FSLDIR/bin/remove_ext $fnm | sed 's/vol//'`; export num; num=`$FSLDIR/bin/remove_ext $fnm | sed 's/vol//'`; export num;
echo $num; echo $num;
$FSLDIR/bin/slicer $fnm -s 2 -a ${iout}_$num.pgm $FSLDIR/bin/slicer $fnm -s 2 -a ${iout}_$num.png
${FSLCONVERT} ${iout}_$num.pgm ${iout}_$num.gif ${FSLDIR}/bin/pngappend ${iout}_$num.png ${iout}_$num.gif
rm -f ${iout}_$num.pgm rm -f ${iout}_$num.png
done done
$FSLDIR/bin/gifmerge -15 -l0 ${iout}_*.gif > ${iout}.gif $FSLDIR/bin/whirlgif -o ${iout}.gif -time 15 -loop 0 ${iout}_*.gif
mv $tmpdir/${iout}.gif ${imoutdir}/${iout}.gif mv $tmpdir/${iout}.gif ${imoutdir}/${iout}.gif
......
...@@ -20,6 +20,12 @@ bool masks_used=false; ...@@ -20,6 +20,12 @@ bool masks_used=false;
bool lthr_used=false; bool lthr_used=false;
bool uthr_used=false; bool uthr_used=false;
#if defined ( __CYGWIN__ ) || defined (__sun)
extern "C" {
#include <ieeefp.h> //for finite
}
#endif
void print_usage(const string& progname) { void print_usage(const string& progname) {
cout << "Usage: avwstats++ <input> [options]" << endl << endl; cout << "Usage: avwstats++ <input> [options]" << endl << endl;
cout << endl; cout << endl;
...@@ -43,6 +49,7 @@ void print_usage(const string& progname) { ...@@ -43,6 +49,7 @@ void print_usage(const string& progname) {
cout << "-p <n> : output nth percentile (n between 0 and 100)" << endl; cout << "-p <n> : output nth percentile (n between 0 and 100)" << endl;
cout << "-P <n> : output nth percentile (for nonzero voxels)" << endl; cout << "-P <n> : output nth percentile (for nonzero voxels)" << endl;
cout << "-a : use absolute values of all image intensities"<< endl; cout << "-a : use absolute values of all image intensities"<< endl;
cout << "-n : treat NaN or Inf as zero for subsequent stats" << endl;
cout << "-k <mask> : use the specified image (filename) for masking - overrides lower and upper thresholds" << endl; cout << "-k <mask> : use the specified image (filename) for masking - overrides lower and upper thresholds" << endl;
cout << "-h <nbins> : output a histogram (for the thresholded/masked voxels only) with nbins" << endl; cout << "-h <nbins> : output a histogram (for the thresholded/masked voxels only) with nbins" << endl;
cout << "-H <nbins> <min> <max> : output a histogram (for the thresholded/masked voxels only) with nbins and histogram limits of min and max" << endl; cout << "-H <nbins> <min> <max> : output a histogram (for the thresholded/masked voxels only) with nbins and histogram limits of min and max" << endl;
...@@ -160,8 +167,14 @@ int fmrib_main_float(int argc, char* argv[]) ...@@ -160,8 +167,14 @@ int fmrib_main_float(int argc, char* argv[])
while (narg<argc) { while (narg<argc) {
sarg=argv[narg]; sarg=argv[narg];
if (sarg=="-n") {
if (sarg=="-m") { for (int t=vol.mint(); t<=vol.maxt(); t++)
for (int z=vol.minz(); z<=vol.maxz(); z++)
for (int y=vol.miny(); y<=vol.maxy(); y++)
for (int x=vol.minx(); x<=vol.maxx(); x++)
if (!finite((double)vol(x,y,z,t)))
vol(x,y,z,t)=0;
} else if (sarg=="-m") {
if (masks_used) cout << vol.mean(mask) << " "; if (masks_used) cout << vol.mean(mask) << " ";
else cout << vol.mean() << " "; else cout << vol.mean() << " ";
} else if (sarg=="-M") { } else if (sarg=="-M") {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# sliceanimate - make animated gif of a volume, slice at a time # sliceanimate - make animated gif of a volume, slice at a time
# #
# Stephen Smith and Mark Jenkinson, FMRIB Image Analysis Group # Stephen Smith, Mark Jenkinson and Matthew Webster FMRIB Image Analysis Group
# #
# Copyright (C) 1999-2004 University of Oxford # Copyright (C) 1999-2007 University of Oxford
# #
# SHCOPYRIGHT # SHCOPYRIGHT
...@@ -25,16 +25,16 @@ tmpdir=/tmp ...@@ -25,16 +25,16 @@ tmpdir=/tmp
while [ $n -lt $nn ] ; do while [ $n -lt $nn ] ; do
# echo $FSLDIR/bin/slicer $volname $@ -z -$n $tmpdir/${tmpnam} # echo $FSLDIR/bin/slicer $volname $@ -z -$n $tmpdir/${tmpnam}
$FSLDIR/bin/slicer $volname $@ -z -$n $tmpdir/${tmpnam} $FSLDIR/bin/slicer $volname $@ -z -$n $tmpdir/${tmpnam}.png
snum=`echo "0000${n}" | sed 's/^.*\(....\)$/\1/'`; snum=`echo "0000${n}" | sed 's/^.*\(....\)$/\1/'`;
echo slice $snum echo slice $snum
${FSLCONVERT} $tmpdir/$tmpnam $tmpdir/${bnm}_slice${snum}.gif ${FSLDIR}/bin/pngappend $tmpdir/${tmpnam}.png $tmpdir/${bnm}_slice${snum}.gif
n=`echo $n + 1 | bc`; n=`echo $n + 1 | bc`;
done done
rm -f $tmpdir/${tmpnam} rm -f $tmpdir/${tmpnam}.png
$FSLDIR/bin/gifmerge -l1000 -35 $tmpdir/${bnm}_slice*.gif > ${volname}_sliceanim.gif $FSLDIR/bin/whirlgif -o ${volname}_sliceanim.gif -time 35 -loop 0 $tmpdir/${bnm}_slice*.gif
rm -f $tmpdir/${bnm}_slice*.gif rm -f $tmpdir/${bnm}_slice*.gif
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