Hello @prms,
Please see reply to your related question.
I suspect you are confusing things between number of pixels and physical size of an image. The resampling code below doesn’t change the size of the image, it just maps the voxels from [x,y,z] to [2x,2y,2z] so the image looks smaller but the whole image remained the same size.
import SimpleITK as sitk
img = sitk.GaussianSource()
sitk.Show(img, 'original image')
print(img.GetSize())
tx = sitk.AffineTransform(3)
tx.SetMatrix([2,0,0,0,2,0,0,0,2])
resampled_img = sitk.Resample(img,tx,defaultPixelValue=255)
sitk.Show(resampled_img, 'resampled image')
print(resampled_img.GetSize())