Source code for bench_textures

import numpy as np
from nabu.reconstruction.fbp_opencl import OpenCLBackprojector
from nabu.testutils import get_data


[docs] def reconstruct_with_textures(sino): Bo_tex = OpenCLBackprojector(sino.shape, backend_options={"device_type": "GPU"}, extra_options={"use_textures": True}) Bo_tex.fbp(sino) # warmup Bo_tex.fbp(sino)
[docs] def reconstruct_without_textures(sino): Bo_tex = OpenCLBackprojector(sino.shape, backend_options={"device_type": "GPU"}, extra_options={"use_textures": False}) Bo_tex.fbp(sino) # warmup Bo_tex.fbp(sino)
if __name__ == "__main__": si = get_data("mri_sino500.npz")["data"] reconstruct_with_textures(si) reconstruct_without_textures(si)