def _create_md_dict(clean_header):
    # Avizo specific metadata
    md_dict = {'software_src': clean_header[0][1],
               'data_format': clean_header[0][2],
               'data_format_version': clean_header[0][3]}
    if md_dict['data_format'] == '3D':
        md_dict['data_format'] = clean_header[0][3]
        md_dict['data_format_version'] = clean_header[0][4]

    for header_line in clean_header:
        hl = header_line
        if 'define' in hl:
            hl = hl
            md_dict['array_dimensions'] = {
                'x_dimension': int(hl[hl.index('define') + 2]),
                'y_dimension': int(hl[hl.index('define') + 3]),
                'z_dimension': int(hl[hl.index('define') + 4])}
        elif 'Content' in hl:
            md_dict['data_type'] = hl[hl.index('Content') + 2]
        elif 'CoordType' in hl:
            md_dict['coord_type'] = hl[hl.index('CoordType') + 1]
        elif 'BoundingBox' in hl:
            hl = hl
            md_dict['bounding_box'] = {
                'x_min': float(hl[hl.index('BoundingBox') + 1]),
                'x_max': float(hl[hl.index('BoundingBox') + 2]),
                'y_min': float(hl[hl.index('BoundingBox') + 3]),
                'y_max': float(hl[hl.index('BoundingBox') + 4]),
                'z_min': float(hl[hl.index('BoundingBox') + 5]),
                'z_max': float(hl[hl.index('BoundingBox') + 6])}

            # Parameter definition for voxel resolution calculations
            bbox = [md_dict['bounding_box']['x_min'],
                    md_dict['bounding_box']['x_max'],
                    md_dict['bounding_box']['y_min'],
                    md_dict['bounding_box']['y_max'],
                    md_dict['bounding_box']['z_min'],
                    md_dict['bounding_box']['z_max']]
            dims = [md_dict['array_dimensions']['x_dimension'],
                    md_dict['array_dimensions']['y_dimension'],
                    md_dict['array_dimensions']['z_dimension']]

            # Voxel resolution calculation
            resolution_list = []
            for index in np.arange(len(dims)):
                if dims[index] > 1:
                    resolution_list.append(
                        (bbox[(2*index+1)] - bbox[(2*index)]) /
                        (dims[index] - 1))
                else:
                    resolution_list.append(0)
            # isotropy determination (isotropic res, or anisotropic res)
            if (resolution_list[1]/resolution_list[0] > 0.99 and
                    resolution_list[2]/resolution_list[0] > 0.99 and
                    resolution_list[1]/resolution_list[0] < 1.01 and
                    resolution_list[2]/resolution_list[0] < 1.01):
                md_dict['resolution'] = {'zyx_value': resolution_list[0],
                                         'type': 'isotropic'}
            else:
                md_dict['resolution'] = {
                    'zyx_value': (resolution_list[2],
                                  resolution_list[1],
                                  resolution_list[0]),
                    'type': 'anisotropic'}

        elif 'Units' in hl:
            try:
                units = str(hl[hl.index('Units') + 2])
                md_dict['units'] = units
            except:
                logging.debug('Units value undefined in source data set. '
                              'Reverting to default units value of pixels')
                md_dict['units'] = 'pixels'
        elif 'Coordinates' in hl:
            coords = str(hl[hl.index('Coordinates') + 1])
            md_dict['coordinates'] = coords
    return md_dict
Set ``session_expires`` to the given datetime.
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/io/avizo_io.py/_create_md_dict--crossover with--dataset/ETHPy150Open gratipay/gratipay.com/gratipay/models/participant.py/Participant.set_session_expires