The singular value decomposition is not equipped to learn rotational and translational invariance of cavity features in the 3D porosity images. Therefore, we must first consistently align the cages so that each pixel in the 3D porosity image corresponds to the same relative location for each cage. Alignment is also required for images of human faces for eigenfaces, so that e.g. the nose and eyes appear in the same region for each face. First, we translate each cage molecule so that its center of mass is at the origin. Second, we determine how to rotate each cage about its center of mass so that cages with similar cavity shapes are aligned.