Rotation augments CT training data by turning an image or volume around the head-foot axis. The transform changes orientation while keeping the sample representative, helping create useful variation without inventing unrealistic anatomy. section 14.6.1
Listing 14.16 Rotating an image
if 'rotate' in augmentation_dict:
angle_rad = random.random() * math.pi * 2
s = math.sin(angle_rad)
c = math.cos(angle_rad)
rotation_t = torch.tensor([
[c, -s, 0, 0],
[s, c, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
])
transform_t @= rotation_t
The rotation branch samples an angle from 0 to 2π, builds an X-Y rotation matrix with sine and cosine, and multiplies it into the affine transform before resampling. section 14.6.1



