def get_bytes_per_data_block(header):
    """Calculates the number of bytes in each 60-sample datablock."""
    if header['version']['major'] == 1:
        num_samples_per_data_block = 60
    else:
        num_samples_per_data_block = 128
    bytes_per_block = num_samples_per_data_block * 4
    bytes_per_block = (bytes_per_block + num_samples_per_data_block * 2 *
        header['num_amplifier_channels'])
    bytes_per_block = (bytes_per_block + num_samples_per_data_block / 4 * 2 *
        header['num_aux_input_channels'])
    bytes_per_block = bytes_per_block + 1 * 2 * header[
        'num_supply_voltage_channels']
    bytes_per_block = (bytes_per_block + num_samples_per_data_block * 2 *
        header['num_board_adc_channels'])
    if header['num_board_dig_in_channels'] > 0:
        bytes_per_block = bytes_per_block + num_samples_per_data_block * 2
    if header['num_board_dig_out_channels'] > 0:
        bytes_per_block = bytes_per_block + num_samples_per_data_block * 2
    if header['num_temp_sensor_channels'] > 0:
        bytes_per_block = bytes_per_block + 1 * 2 * header[
            'num_temp_sensor_channels']
    return bytes_per_block
