nr_projections = 15 src = "/home/andrei/low-dose/DATASET-REGULARIZED/" dest = "/home/andrei/low-dose/DATASET-256 LOW-DOSE/" new_dest = os.path.join(dest, "{}_projections/".format(nr_projections)) try: os.mkdir(new_dest) data = DataInterface(src) scans = data.get_tomo_list() t = 0 for x in scans: vol = data.get_tomo_volume(x) ct = ConeBeamCT(vol) rec = ct.run_new_scan(nr_projections) maxim = rec.max() _, _, z = rec.shape for slice in range(z): im = rec[:, :, slice] # print(im[150]) # im = (normalize.normalize(im)) # im *= 255 / maxim # print(skimage.img_as_ubyte(im)* m) # io.imsave(os.path.join(new_dest, "Tomo_{}_slice_{}.png".format(str(x).zfill(3),str(slice).zfill(3))), skimage.img_as_ubyte(im)* maxim) # im = np.round((im + 1) * 255 / 2) # im = im.astype(np.uin) transform = pp.QuantileTransformer(random_state=0)
astra.algorithm.run(alg_id) rec = astra.data3d.get(rec_id) astra.algorithm.delete(alg_id) astra.data3d.delete(rec_id) astra.data3d.delete(proj_id) return rec if __name__ == "__main__": import pylab from DataInterface import DataInterface src = "/home/andrei/Área de Trabalho/Pesquisa/DATASET-256/" dataset = DataInterface(src) vol = dataset.get_tomo_volume(90) ct = ConeBeamCT(vol) rec = ct.run_new_scan(15) pylab.gray() pylab.figure(1) pylab.imshow(vol[:, :, 128]) pylab.figure(2) pylab.imshow(rec[:, :, 128]) pylab.show()