File: nipy_tsdiffana

package info (click to toggle)
nipy 0.1.2%2B20100526-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,992 kB
  • ctags: 13,434
  • sloc: python: 47,720; ansic: 41,334; makefile: 197
file content (28 lines) | stat: -rwxr-xr-x 900 bytes parent folder | download
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
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Analyze, plot time series difference metrics'''

import nipy.externals.argparse as argparse
import nipy.algorithms.diagnostics as nad


def main():
    # create the parser
    parser = argparse.ArgumentParser()
    # add the arguments
    parser.add_argument('--out-file', type=str,
                        help='graphics file to write to instead '
                        'of leaving image on screen')
    parser.add_argument('filename', type=str,
                        help='4D image filename')
    # parse the command line
    args = parser.parse_args()
    show = args.out_file is None
    axes = nad.plot_tsdiffs_image(args.filename, show=show)
    if args.out_file:
        axes[0].figure.savefig(args.out_file)


if __name__ == '__main__':
    main()