示例#1
0
def mrc2singlepic(mrcfile, pngdir, pngname='', view_dir=1):
    import iomap as IM
    data = IM.readMrcMap(mrcfile)
    if view_dir == 0:
        data = N.transpose(data, [1, 2, 0])
    elif view_dir == 1:
        data = N.transpose(data, [2, 0, 1])
    elif view_dir == 2:
        data = data

    shape = data.shape
    for j in range(shape[0]):
        d = data[j]
        name = pngdir + pngname + '_' + str(j) + '.png'
        if not os.path.exists(pngdir):
            os.makedirs(pngdir)
        save_png(d, name)
        print('save' + name)
def mrc2singlepic(op):
    import iomap as IM
    data = IM.readMrcMap(op['mrcfile'])
    if op['view_dir'] == 0:
        data = N.transpose(data, [1, 2, 0])
    elif op['view_dir'] == 1:
        data = N.transpose(data, [2, 0, 1])
    elif op['view_dir'] == 2:
        data = data

    shape = data.shape
    for j in range(shape[0]):
        d = data[j]
        name = op['pngdir'] + op['pngname'] + '_' + str(j) + '.png'
        if not os.path.exists(op['pngdir']):
            os.makedirs(op['pngdir'])
        save_png(d, name)
        print('save' + name)
示例#3
0
op = {
    'model': {
        'missing_wedge_angle': 30,
        'SNR': 0.4
    },
    'ctf': {
        'pix_size': 1.0,
        'Dz': -5.0,
        'voltage': 300,
        'Cs': 2.0,
        'sigma': 0.4
    }
}


def map2tomo(map1, op):
    vb = TSRSC.do_reconstruction(map1, op, verbose=True)
    #    vb = td(map1, op, verbose=True)

    print('vb', 'mean', vb.mean(), 'std', vb.std(), 'var', vb.var())
    return vb


if __name__ == '__main__':
    import iomap as IM

    packmap = IM.readMrcMap('../IOfile/packmap/mrc/packmap1.mrc')
    vb = map2tomo(packmap, op)
    IM.map2mrc(vb, '../IOfile/tomo/mrc/tomo_SNR04.mrc')
    IM.map2png(vb, '../IOfile/tomo/png/tomo_SNR04.png')