In this paper, a quaternion based extended Kalman filter (EKF) is developed for determining the orientation of a rigid body from the outputs of a sensor which is configured as the integration of a tri-axis gyro and an aiding system mechanized using a tri-axis accelerometer and a tri-axis magnetometer. The suggested applications are for studies in the field of human movement. In the proposed EKF, the quaternion associated with the body rotation is included in the state vector together with the bias of the aiding system sensors. Moreover, in addition to the in-line procedure of sensor bias compensation, the measurement noise covariance matrix is adapted, to guard against the effects which body motion and temporary magnetic disturbance may have on the reliability of measurements of gravity and earth's magnetic field, respectively. By computer simulations and experimental validation with human hand orientation motion signals, improvements in the accuracy of orientation estimates are demonstrated for the proposed EKF, as compared with filter implementations where either the in-line calibration procedure, the adaptive mechanism for weighting the measurements of the aiding system sensors, or both are not implemented.