#!/usr/bin/env python

import os
import argparse
from pkg_resources import resource_filename

def main():
    parser = argparse.ArgumentParser(description="Generate previews of nifti image on the terminal.",
                                    epilog="Written by Jakob Wasserthal")
    parser.add_argument("nifti_file")
    args = parser.parse_args()

    niipre_path = resource_filename('niicat.resources', 'niipre.py')
    imgcat_path = resource_filename('niicat.resources', 'imgcat.sh')

    os.system("python " + niipre_path + " " + args.nifti_file + " | " + imgcat_path)


if __name__ == '__main__':
    main()
