According to the present invention, there is provided a technique for preventing image quality of a three-dimensional image from becoming poor due to fluctuations in the rotation speed of an imaging core. For this purpose, if data is obtained from the imaging core by moving and rotating the imaging core, a cross-sectional image is generated at each movement position. Then, a direction where a guidewire is present in each of the cross-sectional images is detected. An angular difference between the direction of the detected guidewire and a preset direction is obtained so as to rotate each of the cross-sectional images in accordance with the angular difference. Then, the cross-sectional images which are previously rotated in this way are connected to one another, thereby generating the three-dimensional image.