Calculating the extended defect contrast for the X-ray-beam-induced current method