#!/bin/sh

#   imrm - remove image files
#
#   Stephen Smith and Mark Jenkinson, FMRIB Image Analysis Group
#
#
#   The imrm file was originally part of FSL - FMRIB's Software Library
#   http://www.fmrib.ox.ac.uk/fsl
#   imrm has now been placed in the public domain.
#
#   Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
#   Imaging of the Brain), Department of Clinical Neurology, Oxford
#   University, Oxford, UK
#
#

if [ $# -lt 1 ] ; then
  echo "Usage: $0 <list of image names to remove>"
  echo "NB: filenames can be basenames or not"
  exit 1;
fi

for f in $@ ; do
  fn=`${FSLDIR}/bin/remove_ext $f`;
  # do the rm silently
  /bin/rm -f ${fn}.img ${fn}.hdr ${fn}.hdr.gz ${fn}.img.gz ${fn}.nii ${fn}.nii.gz ${fn}.mnc ${fn}.mnc.gz
done
