Measuring spinal and trunk shape using an electromagnetic sensor