1. A method to generate a tomography image, the method comprising: determining a basis pattern from modulated phases of incident rays from a spatial light modulator according to a pattern of arranged pixels; performing spatial shift modulation by deliverately shifting the basis pattern vertically or horizontally to obtain shift patterns of the basis pattern; generating tomography images for the basis pattern and the shift patterns using spectrum signals of rays obtained from the incident rays passing through the spatial light modulator and entering a subject; and selecting a pattern that generates a clearest tomography image of the subject, which has a greatest light intensity among the generated tomography images, among the basis pattern and the shift patterns.