Well not quite sure that's what I had in mind. Maybe this is easier ;)
import Maya.OpenMaya as om
matrix = om.MMatrix() # has index operator
# set matrix elements from sensor data using index operator here
transformation_matrix = om.MTransformationMatrix(matrix) # has no index operator, but has methods for getting rotation
transformation_matrix.reorderRotation(om.MTransformationMatrix.kZXY) # or whatever rotation order you need
euler_rotation = transformation_matrix.eulerRotation()
z_rotation = euler_rotation.z # note: this is in radians
# do whatever you need to do with z_rotation,
# such as create new MEulerRotation and apply
# to another transform with MFnTransform.setRotation()