def full(images: Images, cors: List[ScalarCoR], recon_params: ReconstructionParameters, progress: Optional[Progress] = None) -> Images: progress = Progress.ensure_instance(progress, num_steps=images.height) output_shape = (images.num_sinograms, images.width, images.width) output_images: Images = Images.create_empty_images( output_shape, images.dtype, images.metadata) output_images.record_operation('AstraRecon.full', 'Reconstruction', **recon_params.to_dict()) # FIXME multiple GPU support - just starting up a Pool doesn't seem to work # the GPUs can't initialise the memory properly. Not sure why # num_gpus = AstraRecon._count_gpus() # LOG.info(f"Running with {num_gpus} GPUs") # partial = ptsm.create_partial(AstraRecon.single, ptsm.fwd_gpu_recon, # num_gpus=num_gpus, cors=cors, # proj_angles=proj_angles, recon_params=recon_params) # ptsm.execute(images.sinograms, output_images.data, partial, num_gpus, progress=progress) proj_angles = images.projection_angles() for i in range(images.height): output_images.data[i] = AstraRecon.single_sino( images.sino(i), cors[i], proj_angles, recon_params) progress.update(1, "Reconstructed slice") return output_images
def full(images: Images, cors: List[ScalarCoR], recon_params: ReconstructionParameters, progress: Optional[Progress] = None) -> Images: progress = Progress.ensure_instance(progress, num_steps=images.height) output_shape = (images.num_sinograms, images.width, images.width) output_images: Images = Images.create_empty_images( output_shape, images.dtype, images.metadata) output_images.record_operation('AstraRecon.full', 'Reconstruction', **recon_params.to_dict()) proj_angles = images.projection_angles( recon_params.max_projection_angle) for i in range(images.height): output_images.data[i] = AstraRecon.single_sino( images.sino(i), cors[i], proj_angles, recon_params) progress.update(1, "Reconstructed slice") return output_images