According to one embodiment, an apparatus includes an acquisition unit and a generation unit. The acquisition unit specifies the cycle of pulses in a part that performs periodic motion based on blood flow information in the part. The generation unit rearranges a plurality of two-dimensional images of the part based on the cycle to generate a three-dimensional image.