The notion of generalized X-ray for star sets in a Riemannian manifold is introduced to prove uniqueness theorems for convex bodies contained in a simply convex neighbourhood of a two-manifold. These results extend to the whole space and to arbitrary dimension when spaces of constant curvature are considered. As a consequence, a characterization of centrally symmetric convex bodies is obtained.