def test_check_atlases(): atlases = atlasreader.check_atlases('all') assert len(atlases) == len(atlasreader._ATLASES) atlases = atlasreader.check_atlases('default') assert len(atlases) == len(atlasreader._DEFAULT) atlases = atlasreader.check_atlases(['aal', 'destrieux']) assert atlasreader.check_atlases(atlases) == atlases assert atlasreader.check_atlases(atlases[0]) == atlases[0]
def main(): """ The primary entrypoint for calling atlas reader via the command line All parameters are read via argparse, so this should only be called from the command line! """ opts = _get_parser() create_output(opts.filename, atlas=check_atlases(opts.atlas), voxel_thresh=opts.voxel_thresh, cluster_extent=opts.cluster_extent, prob_thresh=opts.prob_thresh, outdir=opts.outdir)
def queryatlas_main(): """ The primary entrypoint for querying atlases via the command line All parameters are read via argparse, so this should only be called from the command line! """ opts = _queryatlas_parser() print('{0:<25} {1:<25}\n{2:<25} {2:<25}'.format('Atlas', 'Label', '=' * 10)) for atlas in check_atlases(opts.atlas): label = read_atlas_peak(atlas, opts.coordinate, opts.prob_thresh) if isinstance(label, list): label = '\n{}'.format(' ' * 26).join( ['{:>2}% {}'.format(*e) for e in label]) print('{:<25} {}'.format(atlas.atlas, label))