parse_readout_direction function added