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 shifting an arrangement of the pixels vertically or horizontally with respect to the basis pattern 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 based on the generated tomography images.