Controlling Screen luminance during a VEP

It is kind of unclear exactly what you want to do. Luminance is a physical measure of emitted light energy, brightness is a subjective perception (two things can have the same luminance but different perceived brightness); I assume you are not working on subjective brightness perception. You need a photometer to measure your luminous output across the whole range (from [0 0 0] to [1 1 1]), this gets you the relationship between your floating point RGB numbers and what physical light level is emitted. Then normally you need to correct the non-linearity of your display as most have a gamma curve adjustment. Once you have a correction curve, you apply it with PTB and now you know precisely how your RGB value relates to the luminous output, and you can flicker at values plus/minus a given point on that curve to result in the same averaged luminance but a range of different contrasts.

This plot is taken from one of my monitors, top-left showing the non-linear raw luminances (filled dots), and the corrected luminances (open circles) for the [RGB] combined and [R] [G] and [B] channels separately. These measurements were made using a SpectroCal II from CRS, but any photometer will do…

For flicker-VEP, we prefer to use square / sinewave gratings or checkerboards and reverse the phase, but full field flash also works depending on your scientific question…