Detecting and concentrating cancer cells in peripheral blood is of great importance for cancer diagnosis and prognosis. Optically induced dielectrophoresis (ODEP) can achieve high resolution and low optical intensities, and the electrode pattern can be dynamically changed by varied light patterns. By changing the projected light pattern, it is demonstrated to separate high-purity gastric cancer cell lines. Traditionally, the purity of cancer cell isolation by negative selection is 0.9% to 10%; by positive selection it is 50% to 62%. An ODEP technology is proposed to enhance the purity of cancer cell isolation to about 77%.