#! /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) # # # Copyright © 2021 The General Hospital Corporation (Boston, MA) "MGH" # # Terms and conditions for use, reproduction, distribution and contribution # are found in the 'FreeSurfer Software License Agreement' contained # in the file 'LICENSE' found in the FreeSurfer distribution, and here: # # https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense # # Reporting: freesurfer@nmr.mgh.harvard.edu # # set VERSION = 'isanalyze dev'; 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