Undistort depth image before registration to RGB image

I am using the Astra Mini S and the AstraSDK. I want to register the undistorted depth image to the undistorted RGB image since it doesn’t make sense to undistort the depth image after registration. Is there a way of undistorting the depth image before the registration to the RGB image, is this done by default, or is it impossible to undistort the depth image?