Description
What happened?
PR #561 introduced a change to the displacement!
functions in Rotate.jl that centers the range of spin positions in the x, y and z directions prior to rotation. Here, the center in each direction is defined as the arithmetic mean between minimum and maximum values of the corresponding co-ordinate. This center is in general not invariant under rotation around it, if the spin positions are not symmetric under reflection with respect to this center.
Centering coordinates prior to rotation may then lead to a center of rotation which depends on phantom orientation in the case of arbitrary spin positions. For example, for a phantom consisting of three spins placed randomly in the x-y plane, performing two successive rotations around the z-axis will in general lead to use a different center of rotation for the second rotation with respect to the first. As a result, performing a single rotation by the sum of the two angles will not be the same thing as the two successive rotations, even though all rotations use the same orientation of the rotation axis.
This behavior may not be what is expected by the user. A more robust implementation of rotations around a center that moves together with the phantom in the presence of translations may be achieved by centering co-ordinates on the center of gravity of the phantom, that is, the arithmetic average of the co-ordinates of all spins. The center of gravity is invariant under rotation around it.
Environment
OS x86_64-linux-gnu
Julia 1.11.5
KomaMRIPlots 0.9.2
KomaMRIFiles 0.9.1
KomaMRI 0.9.1
KomaMRICore 0.9.1
KomaMRIBase 0.9.1