Exemplo n.º 1
0
                    tolerance=tolerance,
                    dist_table_density=20,
                    exact=True,
                    sigma=0.3)

        path = os.path.join('simulation',
                            '%s_lambda_%f_R_%f' % (fname_base, l, R))
        if sys.version_info < (3, 0):
            path = os.path.join(path, "preprocessed_data/Python_2")
        else:
            path = os.path.join(path, "preprocessed_data/Python_3")
        if not os.path.exists(path):
            print("Creating", path)
            os.makedirs(path)
        try:
            utils.save_sim(path, ker)
        except NameError:
            pass

        skcsd, pot, morphology, ele_pos, n_src = utils.load_sim(path)
        cell_obj = sKCSDcell(morphology, ele_pos, n_src)
        skcsd = cell_itself.transform_to_3D(skcsd)

        ax[(i + 1) // 3, (i + 1) % 3].imshow(morpho,
                                             origin='lower',
                                             aspect='auto',
                                             interpolation='none',
                                             extent=extent)
        pl.make_map_plot(ax[(i + 1) // 3, (i + 1) % 3],
                         skcsd[:, :, :, t0].sum(axis=2),
                         vmin=vmin,
Exemplo n.º 2
0
              n_src_init=n_src,
              src_type='gauss',
              lambd=lambd,
              exact=True,
              R_init=R,
              sigma=0.3)
    path = os.path.join(data_dir, 'lambda_%f_R_%f_n_src_%d' % (lambd, R, n_src))
    if sys.version_info < (3, 0):
        path = os.path.join(path, "preprocessed_data/Python_2")
    else:
        path = os.path.join(path, "preprocessed_data/Python_3")
    if not os.path.exists(path):
        print("Creating", path)
        os.makedirs(path)
    try:
        utils.save_sim(path, k)
    except NameError:
        pass

    skcsd, pot, morphology_file, ele_pos, n_src  = utils.load_sim(path)
    cell_obj = sKCSDcell(morphology_file, ele_pos, n_src)
    csd = cell_obj.transform_to_segments(skcsd)
    draw_ground_truth_skcsd_segments(ax, ground_truth, csd, time, gvmin, gvmax)
    csd_3D = cell_itself.transform_to_3D(skcsd[:, toplot])
    gt_3D = cell_itself.transform_to_3D(ground_truth[:, toplot],
                                        what="morpho")
    draw_ground_truth_skcsd_3D(ax, gt_3D, csd_3D, data,
                                gvmin, gvmax, time[toplot])