#! /bin/tcsh -f

#
# isanalyze - checks whether the passed file is an analyze file
#  exit status 0 - not an analyze
#  exit status 1 - is an analyze
#  exit status 255 - some error
#
#  Looks for a .img extension (exits 1 if so)
#
# Original Author: REPLACE_WITH_FULL_NAME_OF_CREATING_AUTHOR
# CVS Revision Info:
#    $Author: nicks $
#    $Date: 2007/01/06 00:01:14 $
#    $Revision: 1.6 $
#
# 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
#


set VERSION = '$Id: isanalyze,v 1.6 2007/01/06 00:01:14 nicks Exp $';

if($#argv != 1) then
  echo "isanalyze filename"
  exit 255;
endif
set fname = $argv[1];

# Determine from extension
set baseimg = `basename $fname`;
set base = `basename $fname .img`;
set newfname = $base.img
if($baseimg == $newfname) exit 1;

exit 0

