Exemplo n.º 1
0
                        p=p,
                        max_resolutions=max_resolutions,
                        sharpness=sharpness,
                        snr_db=snr_db)

# Compute Normalized Root Mean Squared Error
nrmse = svmbir.phantom.nrmse(recon, phantom)
mr_nrmse = svmbir.phantom.nrmse(mr_recon, phantom)

# create output folder
os.makedirs('output', exist_ok=True)

# display phantom
plot_image(phantom[display_slice],
           title='Shepp Logan Phantom',
           filename='output/3D_microscopy_phantom.png',
           vmin=vmin,
           vmax=vmax)

# display fixed resolution reconstruction
title = f'Slice {display_slice:d} of Fixed Res Recon with NRMSE={nrmse:.3f}.'
plot_image(recon[display_slice],
           title=title,
           filename='output/mr_3D_microscopy_recon.png',
           vmin=vmin,
           vmax=vmax)

# display multi-resolution reconstruction
title = f'Slice {display_slice:d} of Multi-Res Recon with NRMSE={mr_nrmse:.3f}.'
plot_image(recon[display_slice],
           title=title,
Exemplo n.º 2
0
                     T=T,
                     p=p,
                     max_resolutions=max_resolutions,
                     sharpness=sharpness,
                     snr_db=snr_db)

# Compute Normalized Root Mean Squared Error
nrmse = svmbir.phantom.nrmse(recon[0], phantom[0])

# create output folder
os.makedirs('output', exist_ok=True)

# display phantom
plot_image(phantom[0],
           title='Shepp Logan Phantom',
           filename='output/2D_microscopy_phantom.png',
           vmin=vmin,
           vmax=vmax)

# display sinogram
plot_image(np.squeeze(sino),
           title='Sinogram',
           filename='output/2D_microscopy_sinogram.png')

# display reconstruction
title = f'Reconstruction with NRMSE={nrmse:.3f}.'
plot_image(recon[0],
           title=title,
           filename='output/2D_microscopy_recon.png',
           vmin=vmin,
           vmax=vmax)
Exemplo n.º 3
0
recon = svmbir.recon(sino,
                     angles,
                     T=T,
                     p=p,
                     sharpness=sharpness,
                     snr_db=snr_db)

# Compute Normalized Root Mean Squared Error
nrmse = svmbir.phantom.nrmse(recon, phantom)

# create output folder
os.makedirs('output', exist_ok=True)

# display phantom
title = f'Slice {display_slice:d} of 3D Shepp Logan Phantom.'
plot_image(phantom[display_slice],
           title=title,
           filename='output/3d_shepp_logan_phantom.png',
           vmin=vmin,
           vmax=vmax)

# display fix resolution reconstruction
title = f'Slice {display_slice:d} of 3D Recon with NRMSE={nrmse:.3f}.'
plot_image(recon[display_slice],
           title=title,
           filename='output/3d_shepp_logan_recon.png',
           vmin=vmin,
           vmax=vmax)

input("press Enter")
Exemplo n.º 4
0
                     angles,
                     max_resolutions=max_resolutions,
                     init_image=phantom_rot,
                     prox_image=phantom_rot,
                     positivity=False,
                     sigma_x=sigma_x,
                     snr_db=snr_db)

# create output folder
os.makedirs('output', exist_ok=True)

# display phantom
title = f'Slice {display_slice:d} of 3D Shepp Logan Phantom.'
plot_image(phantom[display_slice],
           title=title,
           filename='output/prox_phantom.png',
           vmin=vmin,
           vmax=vmax)

title = f'Slice {display_slice:d} of Rotated Phantom.'
plot_image(phantom_rot[display_slice],
           title=title,
           filename='output/prox_rotated_phantom.png',
           vmin=vmin,
           vmax=vmax)

# display reconstruction
title = f'Slice {display_slice:d} of 3D Proximal Map Recon.'
plot_image(recon[display_slice],
           title=title,
           filename='output/prox_recon.png',