Did you follow @mauigna06’s advice? Based on the images, I’m surprised that for the top image the median of the four corners is -1024. If this is indeed correct, then use the median of a slightly larger region next to the corners and that should be closer to -3024.
Is it possible to do registration so that the slices match in the two images (two different datasets) after registration. For example, slice 50 (let’s say it shows the liver region) in image1 from dataset1 matches with the slices 50 in image2 from dataset2?
The result of registration is a transformation mapping points from the fixed image to the moving image. Most often, we use that transformation to resample the moving image onto the fixed image grid, which is exactly what you are asking for.
Take a look at the jupyter notebooks, you’re looking for moving_resampled = ...