cmdline

Functionality to be exposed in the command line

Module: cmdline.dicomfs

DICOMFS(*args, **kwargs)
FileHandle(fno)
dummy_fuse Dummy fuse “module” so that nose does not blow during doctests
get_opt_parser()
main([args])

Module: cmdline.ls

Output a summary table for neuroimaging files (resolution, dimensionality, etc.)

get_opt_parser()
main([args]) Show must go on
proc_file(f, opts)

Module: cmdline.nifti_dx

Print nifti diagnostics for header files

main([args]) Go go team

Module: cmdline.parrec2nii

Code for PAR/REC to NIfTI converter command

error(msg, exit_code)
get_opt_parser()
main()
proc_file(infile, opts)
verbose(msg[, indent])

Module: cmdline.tck2trk

Convert tractograms (TCK -> TRK).

main()
parse_args()

Module: cmdline.trk2tck

Convert tractograms (TRK -> TCK).

main()
parse_args()

Module: cmdline.utils

Helper utilities to be used in cmdline applications

ap(helplist, format_[, sep]) Little helper to enforce consistency
safe_get(obj, name) A getattr which would return ‘-‘ if getattr fails
table2string(table[, out]) Given list of lists figure out their common widths and print to out
verbose(thing, msg) Print s if thing is less than the verbose_level

DICOMFS

class nibabel.cmdline.dicomfs.DICOMFS(*args, **kwargs)

Bases: fuse.Fuse

__init__(*args, **kwargs)

Not much happens here apart from initializing the parser attribute. Arguments are forwarded to the constructor of the parser class almost unchanged.

The parser class is FuseOptParse unless you specify one using the parser_class keyword. (See FuseOptParse documentation for available options.)

get_paths()
getattr(path)
match_path(path)
open(path, flags)
read(path, size, offset, fh)
readdir(path, fh)
release(path, flags, fh)

FileHandle

class nibabel.cmdline.dicomfs.FileHandle(fno)
__init__(fno)

dummy_fuse

class nibabel.cmdline.dicomfs.dummy_fuse

Bases: object

Dummy fuse “module” so that nose does not blow during doctests

__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

Fuse

alias of __builtin__.object

get_opt_parser

nibabel.cmdline.dicomfs.get_opt_parser()

main

nibabel.cmdline.dicomfs.main(args=None)

get_opt_parser

nibabel.cmdline.ls.get_opt_parser()

main

nibabel.cmdline.ls.main(args=None)

Show must go on

proc_file

nibabel.cmdline.ls.proc_file(f, opts)

main

nibabel.cmdline.nifti_dx.main(args=None)

Go go team

error

nibabel.cmdline.parrec2nii.error(msg, exit_code)

get_opt_parser

nibabel.cmdline.parrec2nii.get_opt_parser()

main

nibabel.cmdline.parrec2nii.main()

proc_file

nibabel.cmdline.parrec2nii.proc_file(infile, opts)

verbose

nibabel.cmdline.parrec2nii.verbose(msg, indent=0)

main

nibabel.cmdline.tck2trk.main()

parse_args

nibabel.cmdline.tck2trk.parse_args()

main

nibabel.cmdline.trk2tck.main()

parse_args

nibabel.cmdline.trk2tck.parse_args()

ap

nibabel.cmdline.utils.ap(helplist, format_, sep=', ')

Little helper to enforce consistency

safe_get

nibabel.cmdline.utils.safe_get(obj, name)

A getattr which would return ‘-‘ if getattr fails

table2string

nibabel.cmdline.utils.table2string(table, out=None)

Given list of lists figure out their common widths and print to out

Parameters:

table : list of lists of strings

What is aimed to be printed

out : None or stream

Where to print. If None – will print and return string

Returns:

string if out was None

verbose

nibabel.cmdline.utils.verbose(thing, msg)

Print s if thing is less than the verbose_level