def load(config: Dict):
    top_vols = config['top']['specimens']
    bottom = config['bottom']['specimens']
    if bottom:
        bottom_vols = config['bottom']['specimens']
    else:
        bottom_specs = []
        bottom_vols = []
        bottom_labels = []
    app = QtGui.QApplication([])
    ex = Vpv()
    p2s = (lambda x: [str(z) for z in x])
    all_vols = (top_vols + bottom_vols)
    ex.load_volumes(chain(p2s(top_vols), p2s(bottom_vols)), 'vol')
    for i in range(3):
        try:
            vol_id = Path(top_vols[i]).stem
            ex.views[i].layers[Layers.vol1].set_volume(vol_id)
        except IndexError:
            continue
    if bottom:
        for i in range(3):
            try:
                vol_id = Path(bottom_vols[i]).stem
                ex.views[(i + 3)].layers[Layers.vol1].set_volume(vol_id)
            except IndexError:
                continue
    print('Finished loading')
    ex.data_manager.show2Rows((True if bottom else False))
    ex.data_manager.on_orientation(config['orientation'])
    sys.exit(app.exec_())
def load(config: Dict):
    top_vols = config['top']['specimens']
    bottom = config['bottom']['specimens']
    if bottom:
        bottom_vols = config['bottom']['specimens']
    else:
        bottom_specs = []
        bottom_vols = []
        bottom_labels = []
    app = QtGui.QApplication([])
    ex = Vpv()
    p2s = (lambda x: [str(z) for z in x])
    all_vols = (top_vols + bottom_vols)
    ex.load_volumes(chain(p2s(top_vols), p2s(bottom_vols)), 'vol')
    for i in range(3):
        try:
            vol_id = Path(top_vols[i]).stem
            ex.views[i].layers[Layers.vol1].set_volume(vol_id)
        except IndexError:
            continue
    if bottom:
        for i in range(3):
            try:
                vol_id = Path(bottom_vols[i]).stem
                ex.views[(i + 3)].layers[Layers.vol1].set_volume(vol_id)
            except IndexError:
                continue
    print('Finished loading')
    ex.data_manager.show2Rows((True if bottom else False))
    ex.data_manager.on_orientation(config['orientation'])
    sys.exit(app.exec_())