How are you saving the raster result after adding gains and offsets to the header? What code are you using?
The example here shows how to update the metadata to add in gains and offsets:
http://www.harrisgeospati...calibrationtask.html Note it passes the virtual raster to the calibration routine. If you want to save the result, you will need to do a save on the raster.