Skip to content
Snippets Groups Projects
Commit 1587e85a authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Tweaks to x5 scripts

parent a53e041f
No related branches found
No related tags found
No related merge requests found
...@@ -129,9 +129,9 @@ def main(args=None): ...@@ -129,9 +129,9 @@ def main(args=None):
args = sys.argv[1:] args = sys.argv[1:]
print() print()
print('Warning: this version of fsl_apply_x5 is a development release. ' print('Warning: this version of fsl_apply_x5 is a development release.\n'
'Interface, behaviour, and input/output formats of future versions ' 'Interface, behaviour, and input/output formats of future versions\n'
'may differ from this version.') 'may differ substantially from this version.')
print() print()
args = parseArgs(args) args = parseArgs(args)
......
...@@ -11,6 +11,7 @@ transformation file formats. ...@@ -11,6 +11,7 @@ transformation file formats.
import os.path as op import os.path as op
import functools as ft import functools as ft
import textwrap as tw
import sys import sys
import shutil import shutil
import logging import logging
...@@ -46,10 +47,15 @@ def parseArgs(args): ...@@ -46,10 +47,15 @@ def parseArgs(args):
'name.', 'name.',
} }
epilog = tw.dedent("""
If the input and output file formats are the same, the input file
is simply copied to the output file.
""").strip()
parser = argparse.ArgumentParser('fsl_convert_x5') parser = argparse.ArgumentParser('fsl_convert_x5')
subparsers = parser.add_subparsers(dest='ctype') subparsers = parser.add_subparsers(dest='ctype')
flirt = subparsers.add_parser('flirt') flirt = subparsers.add_parser('flirt', epilog=epilog)
fnirt = subparsers.add_parser('fnirt') fnirt = subparsers.add_parser('fnirt', epilog=epilog)
imgtype = ft.partial(parse_data.Image, loadData=False) imgtype = ft.partial(parse_data.Image, loadData=False)
flirt.add_argument('input', help=helps['input']) flirt.add_argument('input', help=helps['input'])
...@@ -79,8 +85,12 @@ def parseArgs(args): ...@@ -79,8 +85,12 @@ def parseArgs(args):
sys.exit(0) sys.exit(0)
if len(args) == 1: if len(args) == 1:
if args[0] == 'flirt': flirt.print_help() if args[0] == 'flirt':
elif args[0] == 'fnirt': fnirt.print_help() flirt.print_help()
sys.exit(0)
elif args[0] == 'fnirt':
fnirt.print_help()
sys.exit(0)
args = parser.parse_args(args) args = parser.parse_args(args)
...@@ -187,9 +197,9 @@ def main(args=None): ...@@ -187,9 +197,9 @@ def main(args=None):
args = sys.argv[1:] args = sys.argv[1:]
print() print()
print('Warning: this version of fsl_convert_x5 is a development release. ' print('Warning: this version of fsl_convert_x5 is a development release.\n'
'Interface, behaviour, and input/output formats of future versions ' 'Interface, behaviour, and input/output formats of future versions\n'
'may differ from this version.') 'may differ substantially from this version.')
print() print()
args = parseArgs(args) args = parseArgs(args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment