operator = odl.tomo.RayTransform(space, geometry, impl=astra_impl) #this operator to create the corresponding phantoms (with the full specified layer) #operator is a function class (so simply calling the operator, will call out the function) # Ensure operator has fixed operator norm for scale invariance opnorm = odl.power_method_opnorm(operator) operator = (1 / opnorm) * operator # Create tensorflow layer from odl operator print("\ngenerating operator tensorflow layer") odl_op_layer = odl.contrib.tensorflow.as_tensorflow_layer(operator, 'RayTransform') print("generating adjoint operator tensorflow layer") odl_op_layer_adjoint = odl.contrib.tensorflow.as_tensorflow_layer(operator.adjoint, 'RayTransformAdjoint') partial_op = partial.PartialRay(space, impl=astra_impl) print("preparing the partial layer") odl_op_partial_layer = partial.tensor_partial_layer(partial_op, 'PartialRayTransform') odl_op_partial_layer_adjoint = partial.tensor_partial_layer(partial_op.adjoint, 'PartialRayTransformAdjoint') # Retrieving the angle projections angle_partition = uniform_partition(0, np.pi, n_angles) projections_array = (np.array(angle_partition.grid.coord_vectors)).ravel() selection_array = np.arange(n_angles) n_data = 5 n_iter = 2 n_primal = 5 n_dual = 5
#operator is a function class (so simply calling the operator, will call out the function) # Ensure operator has fixed operator norm for scale invariance opnorm = odl.power_method_opnorm(operator) operator = (1 / opnorm) * operator # Create tensorflow layer from odl operator print("\ngenerating operator tensorflow layer") odl_op_layer = odl.contrib.tensorflow.as_tensorflow_layer( operator, 'RayTransform') print("generating adjoint operator tensorflow layer") odl_op_layer_adjoint = odl.contrib.tensorflow.as_tensorflow_layer( operator.adjoint, 'RayTransformAdjoint') partial_op = partial.PartialRay(space, impl='astra_cuda') print("preparing the partial layer") odl_op_partial_layer = partial.tensor_partial_layer(partial_op, 'PartialRayTransform') odl_op_partial_layer_adjoint = partial.tensor_partial_layer( partial_op.adjoint, 'PartialRayTransformAdjoint') # Retrieving the angle projections angle_partition = uniform_partition(0, np.pi, n_angles) projections_array = (np.array(angle_partition.grid.coord_vectors)).ravel() selection_array = np.arange(n_angles) n_data = 5 n_iter = 10 n_primal = 5