#! /bin/csh -f

#
# getbfvdim - gets the dimensions of a volume stored in bfile format
#
# Original Author: Doug Greve
# CVS Revision Info:
#    $Author: nicks $
#    $Date: 2007/01/09 22:41:17 $
#    $Revision: 1.2 $
#
# Copyright (C) 2002-2007,
# The General Hospital Corporation (Boston, MA). 
# All rights reserved.
#
# Distribution, usage and copying of this software is covered under the
# terms found in the License Agreement file named 'COPYING' found in the
# FreeSurfer source code root directory, and duplicated here:
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense
#
# General inquiries: freesurfer@nmr.mgh.harvard.edu
# Bug reports: analysis-bugs@nmr.mgh.harvard.edu
#


if($#argv == 0) then
  echo "USAGE: getbfvdim stem"
  echo " returns: nslices nrows ncols nframes bext endian"
  exit 1;
endif

set stem = $argv[1];

set nslices = `getnslices $stem`;
if($status) exit 1;

set nrows = `getnrows $stem`;
if($status) exit 1;

set ncols = `getncols $stem`;
if($status) exit 1;

set nframes = `getnframes $stem`;
if($status) exit 1;

set bext = `getbext $stem`;
if($status) exit 1;

set endian = `getendian $stem`;
if($status) exit 1;

echo $nslices $nrows $ncols $nframes $bext $endian


exit 0;
