I want to scale a 3D image by some factor, and I was expecting that the scale factor in ScaleTransform would give me a zoomed-out image when the scale factor is smaller than 1.0. Unfortunately this is not the case. I get the inverse behavior. See example code below, and resulting image slice,
image_center = 0.5 * np.array(image.shape)[::-1] scale = sitk.ScaleTransform(3, 1.8 * np.ones(3)) scale.SetCenter(image_center) sitk_image = sitk.GetImageFromArray(patch) sitk_image_scaled = sitk.Resample(sitk_image, scale, sitk.sitkBSpline, 0.0, useNearestNeighborExtrapolator=True)
Is my understanding of how
ScaleTransform works wrong? If e.g. you look here, it says that ITK’s
ScaleTransform should result in an enlarged image when the scale is larger than 1.0.