def _(physical_model, projection_data, image): image = transpose(image) result = physical_model.op.maplors(image=image.data, grid=list(image.grid[::-1]), center=list(image.center[::-1]), size=list(image.size[::-1]), lors=transpose(projection_data.lors), lors_value=projection_data.values) return transpose(Image(result, image.center[::-1], image.size[::-1]))
def _(physical_model, image, projection_data): image = transpose(image) result = physical_model.op.projection( lors=transpose(projection_data.lors), image=image.data, grid=list(image.grid[::-1]), center=list(image.center[::-1]), size=list(image.size[::-1]), tof_bin=physical_model.config[physical_model.KEYS.CONFIG.TOF_BIN], tof_sigma2=physical_model.config[ physical_model.KEYS.CONFIG.TOF_SIGMA2]) return ListModeData(projection_data.lors, result)
def _(physical_model, projection_data, image): image = transpose(image) result = physical_model.op.backprojection( image=image.data, grid=list(image.grid[::-1]), center=list(image.center[::-1]), size=list(image.size[::-1]), lors=transpose(projection_data.lors), lors_value=projection_data.values, tof_bin=physical_model.config[physical_model.KEYS.CONFIG.TOF_BIN], tof_sigma2=physical_model.config[ physical_model.KEYS.CONFIG.TOF_SIGMA2]) return transpose(Image(result, image.center[::-1], image.size[::-1]))
def _(physical_model, projection_data, image): image = transpose(image) result = physical_model.op.backprojection( image=image.data, sino=projection_data.data, grid=list(image.grid[::-1]), center=list(image.center[::-1]), size=list(image.size[::-1]), block_grid = list(physical_model.config[physical_model.KEYS.CONFIG.BLOCK_GRID][::-1]), block_size = list(physical_model.config[physical_model.KEYS.CONFIG.BLOCK_SIZE][::-1]), block_center = list(physical_model.config[physical_model.KEYS.CONFIG.BLOCK_CENTER][::-1]), inner_radius = physical_model.config[physical_model.KEYS.CONFIG.INNER_RADIUS], outer_radius = physical_model.config[physical_model.KEYS.CONFIG.OUTER_RADIUS], nb_rings = physical_model.config[physical_model.KEYS.CONFIG.NB_RINGS], nb_blocks_per_ring = physical_model.config[physical_model.KEYS.CONFIG.NB_BLOCKS_PER_RING], gap = physical_model.config[physical_model.KEYS.CONFIG.GAP]) return transpose(Image(result, image.center[::-1], image.size[::-1]))
def _(model, projection_data, image): result = [] # print("geometry sigma2 flag:",model.config[model.KEYS.GEO_SIGMA2_FLAG]) for a in model.AXIS: # for a in ['x', 'z']: image_axis = transpose(image, model.perm(a)) backproj = Op.get_module().maplors( image=image_axis.data, grid=list(image_axis.grid[::-1]), center=list(image_axis.center[::-1]), size=list(image_axis.size[::-1]), lors=transpose(projection_data[a].lors), lors_value=projection_data[a].values, kernel_width=model.config[model.KEYS.KERNEL_WIDTH], geo_sigma2_flag=model.config[model.KEYS.GEO_SIGMA2_FLAG]) result.append(transpose(backproj, model.perm_back(a))) return Image(sum_(result), image.center, image.size)
def _(model, image, projection_data): result = {} # print("tof_sigma2: ", model.config[model.KEYS.TOF_SIGMA2]) for a in model.AXIS: # for a in ('x','y'): image_axis = transpose(image, model.perm(a)) result[a] = Op.get_module().projection( lors=transpose(projection_data[a].lors), image=image_axis.data, grid=list(image_axis.grid[::-1]), center=list(image_axis.center[::-1]), size=list(image_axis.size[::-1]), kernel_width=model.config[model.KEYS.KERNEL_WIDTH], geo_sigma2_flag=model.config[model.KEYS.GEO_SIGMA2_FLAG], tof_bin=model.config[model.KEYS.TOF_BIN], tof_sigma2=model.config[model.KEYS.TOF_SIGMA2]) return ListModeDataSplit( * [ListModeData(projection_data[a].lors, result[a]) for a in model.AXIS])
def _(t, perm=None): if perm is None: perm = [2, 1, 0] center = [t.center[p] for p in perm] size = [t.size[p] for p in perm] return Image(transpose(t.data, perm), center=center, size=size)