/usr/bin/nib-nifti-dx is in python-nibabel 2.0.2-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #! /usr/bin/python
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
''' Print nifti diagnostics for header files '''
from __future__ import division, print_function, absolute_import
import sys
from optparse import OptionParser
import nibabel as nib
def main():
""" Go go team """
parser = OptionParser(
usage="%s [FILE ...]\n\n" % sys.argv[0] + __doc__,
version="%prog " + nib.__version__)
(opts, files) = parser.parse_args()
for fname in files:
with nib.volumeutils.BinOpener(fname) as fobj:
hdr = fobj.read(nib.nifti1.header_dtype.itemsize)
result = nib.Nifti1Header.diagnose_binaryblock(hdr)
if len(result):
print('Picky header check output for "%s"\n' % fname)
print(result + '\n')
else:
print('Header for "%s" is clean' % fname)
if __name__ == '__main__':
main()
|