The wireline gamma-ray log is sensitive to open-hole conditions and, in particular, the diameter. This means that the log can jump at casing points. Although environmental corrections exist, they can fail at these points. We present a Bayesian method for deriving a new quantity – the shifted gamma–ray index – that takes these shifts into account by fitting a piecewise linear function to open-hole data in a depth window around the casing point. Because it is Bayesian, the method enables us to assess our uncertainty about its performance. This method requires very little knowledge of the borehole or drilling conditions but relies on the assumption that the lithology is consistent. Investigating the other wireline logs enables us to assess whether this assumption is valid. We demonstrate our method using well data from offshore mid-Norway.