According to one embodiment, a data processing method is used for processing collected data acquired with respect to each A-line by swept-source OCT using a wavelength sweeping light source having a predetermined wavelength sweeping range includes. The data processing method detects a reference signal assigned to a predetermined wavelength position within the predetermined wavelength sweeping range. The data processing method sequentially performs the sampling of the collected data based on a clock from a clock generator configured to operate independently of the wavelength sweeping light source with reference to the predetermined wavelength position where the reference signal detected is assigned. The data processing method forms an image of a corresponding A-line based on the collected data.