Ejemplo n.º 1
0
def run(args):
    plot_scatter_files(args.data,
                       mask_file=args.mask_file,
                       masked_opacity=args.masked_opacity,
                       volume=args.volume,
                       thresholds=args.thresholds,
                       limits=args.limits,
                       x_jitter=args.x_jitter,
                       y_jitter=args.y_jitter,
                       uniq=args.unique_points,
                       include_stats=args.stats)
    if args.output_img:
        pl.savefig(args.output_img)
    pl.show()
Ejemplo n.º 2
0
def run(args):
    plot_scatter_files(args.data,
                       mask_file=args.mask_file,
                       masked_opacity=args.masked_opacity,
                       volume=args.volume,
                       thresholds=args.thresholds,
                       limits=args.limits,
                       x_jitter=args.x_jitter,
                       y_jitter=args.y_jitter,
                       uniq=args.unique_points,
                       include_stats=args.stats)
    if args.output_img:
        pl.savefig(args.output_img)
    pl.show()
Ejemplo n.º 3
0
def test_plot_scatter_files_with_styles(kw):
    fns = glob(pjoin(pymvpa_dataroot,
                     *('haxby2001/sub001/anatomy/lowres00*.nii.gz'.split('/'))))
    figs = plot_scatter_files(fns, **kw)
    # all of those produce 1 figure since we have only 2 files
    assert(figs)
    if kw.get('style', None) in {'full', 'pair2', 'upper_triang'}:
        # TODO: unify API
        assert(isinstance(figs[0], Figure))
    else:
        assert(isinstance(figs, Figure))

    # now let's give 3 files
    figs = plot_scatter_files(fns + fns[-1:], **kw)
    assert_equal(len(figs), 2)
    pl.close('all')
Ejemplo n.º 4
0
def test_plot_scatter_files_with_styles(kw):
    fns = glob(pjoin(pymvpa_dataroot,
                     *('haxby2001/sub001/anatomy/lowres00*.nii.gz'.split('/'))))
    figs = plot_scatter_files(fns, **kw)
    # all of those produce 1 figure since we have only 2 files
    assert(figs)
    if kw.get('style', None) in {'full', 'pair2', 'upper_triang'}:
        # TODO: unify API
        assert(isinstance(figs[0], Figure))
    else:
        assert(isinstance(figs, Figure))

    # now let's give 3 files
    figs = plot_scatter_files(fns + fns[-1:], **kw)
    assert_equal(len(figs), 2)
    pl.close('all')
Ejemplo n.º 5
0
def test_plot_scatter_files_mask():
    fns = glob(pjoin(pymvpa_dataroot,
                     *('haxby2001/sub001/anatomy/lowres00*.nii.gz'.split('/'))))
    # figure out reasonable threshold
    data = _get_data(fns[0])
    min_, max_ = np.min(data), np.max(data)
    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=(min_ + max_)/2.,
                       masked_opacity=0.5)
    # now fancier ones
    thrs = [min_ + (max_ - min_) * 0.2, min_ + (max_ - min_) * 0.8]
    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=thrs,
                       masked_opacity=0.5)

    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=thrs[::-1],
                       masked_opacity=0.5)
    pl.close('all')
Ejemplo n.º 6
0
def test_plot_scatter_files_mask():
    fns = glob(pjoin(pymvpa_dataroot,
                     *('haxby2001/sub001/anatomy/lowres00*.nii.gz'.split('/'))))
    # figure out reasonable threshold
    data = _get_data(fns[0])
    min_, max_ = np.min(data), np.max(data)
    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=(min_ + max_)/2.,
                       masked_opacity=0.5)
    # now fancier ones
    thrs = [min_ + (max_ - min_) * 0.2, min_ + (max_ - min_) * 0.8]
    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=thrs,
                       masked_opacity=0.5)

    plot_scatter_files(fns, mask_file=fns[0], mask_thresholds=thrs[::-1],
                       masked_opacity=0.5)
    pl.close('all')