imtest
来自「DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.」· 代码 · 共 54 行
TXT
54 行
#!/bin/sh
# imtest - test to see if a valid image file exists with this name (root)
#
# Stephen Smith and Mark Jenkinson, FMRIB Image Analysis Group
#
#
# The fslio.c file was originally part of FSL - FMRIB's Software Library
# http://www.fmrib.ox.ac.uk/fsl
# imtest 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
#
#
# return 0 if no image exists or 1 if the image exists
if [ $# -lt 1 ] ; then
echo "0";
exit;
fi
filename=`${FSLDIR}/bin/remove_ext $1`;
if [ -r ${filename}.nii -o -r ${filename}.nii.gz ] ; then
echo "1";
exit;
fi
if [ -r ${filename}.mnc -o -r ${filename}.mnc.gz ] ; then
echo "1";
exit;
fi
if [ ! -r ${filename}.hdr -a ! -r ${filename}.hdr.gz ] ; then
# return 0 here as no header exists and no single image means no image!
echo "0";
exit;
fi
if [ ! -r ${filename}.img -a ! -r ${filename}.img.gz ] ; then
# return 0 here as no img file exists and no single image means no image!
echo "0";
exit;
fi
# only gets to here if there was a hdr and an img file
echo "1";
exit;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?