# test writing various output file types nifti_tool -make_im -prefix new1.hdr nifti_tool -make_im -prefix new2.hdr.gz nifti_tool -make_im -prefix new3.img.gz nifti_tool -make_im -prefix new4.nii.gz nifti_tool -make_im -prefix new5.nia # test reading them nifti_tool -copy_image -prefix ncopy1.nii -infiles new1.hdr nifti_tool -copy_image -prefix ncopy2.nii -infiles new2.hdr.gz nifti_tool -copy_image -prefix ncopy3.nii -infiles new3.img.gz nifti_tool -copy_image -prefix ncopy4.nii -infiles new4.nii.gz nifti_tool -copy_image -prefix ncopy5.nii -infiles new5.nia # verify that they are all the same # note: MAKE_IM defaults to NIFTI-2, while .nia is NIFTI-1, # so either skip index 5 or convert to NIFTI-2 set count = 0 foreach index ( 2 3 4 5 ) diff ncopy1.nii ncopy$index.nii if ( $status ) echo "-- failure on test index $index --" end