def test_run_roi_stats_via_CLI(): " ensures the CLI works. " sys.argv = shlex.split('graynet -s {} -i {} -r median gmean -o {} -a {}' ''.format(sub_list, example_dir, out_dir, atlas)) run_cli()
def test_CLI_weight(): " ensures the CLI works. " sys.argv = shlex.split('graynet -s {} -i {} -w manhattan -o {} -a {}' ''.format(sub_list, example_dir, out_dir, atlas)) run_cli()
def test_CLI_only_weight_or_stats(): " ensures the CLI works. " with raises(SystemExit): sys.argv = shlex.split( 'graynet -s {} -i {} -w cosine -r median gmean -o {} -a {}' ''.format(sub_list, example_dir, out_dir, atlas)) run_cli()
def test_multi_edge_CLI(): sys.argv = shlex.split( 'graynet -s {} -i {} ' ' -f freesurfer_thickness freesurfer_curv' ' --do_multi_edge --multi_edge_range 0.0 5.0 -0.3 +0.3 ' ' -w manhattan -o {} -a {}' ''.format(sub_list, example_dir, out_dir, atlas)) run_cli()
def test_empty_subject_list(): # API with raises(ValueError): ew = graynet.extract([], fs_dir) # in CLI, only non-Freesurfer lead to an error for feat in cfg.features_volumetric: # invalid list with raises(ValueError): sys.argv = shlex.split('graynet -i {} -f {}'.format(fs_dir, feat)) run_cli()
def test_multi_edge_summary_stat_CLI(): ss_list = ' '.join( ['prod', 'median', 'max', 'min', 'gmean', 'hmean', 'std']) sys.argv = shlex.split( 'graynet -s {} -i {} ' ' -f freesurfer_thickness freesurfer_curv' ' --do_multi_edge --multi_edge_range 0.0 5.0 -0.3 +0.3 ' ' -w manhattan cosine --summary_stat {} ' '-o {} -a {}' ''.format(sub_list, example_dir, ss_list, out_dir, atlas)) run_cli()