contrast sensitivity

I am a new user of the Psychtoolbox and am interested in measuring contrast
thresholds for stationary sine-wave gratings with the demo program called
Contrast Threshold Demo (CTD). I modified the program slightly to omit the
visual noise masking. I have several beginner questions I hope somebody can
answer for me.
1. How does one calibrate the CTD for use? I wrote a small program in
Matlab to display each of the 255 grey levels and measure those with a
photometer. I then entered those values in a one-dimensional matrix and
tried to get the program to utilize them as the CLUT, but that did not work.
2. Second, using whatever calibration comes with the program, my contrast
sensitivity curves were flat for all of the middle spatial frequencies. I
thought the Quest routine might be the problem, but Dennis Pelli suggested
I get a 10 bit graphics adaptor, which I did. He said that the program
automatically accommodated to the new hardware and should provide the grey
scale resolution to fix the flattening problem with mid spatial
frequencies. It did not. I would really appreciate any help you could give.

Thanks,
Rich