sidpy/hdf/reg_ref.py
def simple_region_ref_copy(h5_source, h5_target, key):
    """
    Copies a region reference from one dataset to another
    without alteration

    Parameters
    ----------
    h5_source : HDF5 Dataset
            source dataset for region reference copy
    h5_target : HDF5 Dataset
            target dataset for region reference copy
    key : String
            Name of attribute in h5_source that contains
            the Region Reference to copy

    Returns
    -------
    ref_inds : Nx2x2 array of unsigned integers
            Array containing pairs of points that define
            the corners of each hyperslab in the region
            reference

    """
    for param, param_name in zip([h5_source, h5_target],
                                 ['h5_source', 'h5_target']):
        if not isinstance(param, h5py.Dataset):
            raise TypeError(param_name + ' should be a h5py.Dataset object')
    if not isinstance(key, (str, unicode)):
        raise TypeError('key should be a string')

    ref = h5_source.attrs[key]
    ref_inds = get_indices_for_region_ref(h5_source, ref,
                                          return_method='corners')
    ref_inds = ref_inds.reshape([-1, 2, 2])
    ref_inds[:, 1, 1] = h5_target.shape[1] - 1
    target_ref = create_region_reference(h5_target, ref_inds)
    h5_target.attrs[key] = target_ref
    return ref_inds

    Copies a region reference from one dataset to another
    without alteration

    Parameters
    ----------
    h5_source : HDF5 Dataset
            source dataset for region reference copy
    h5_target : HDF5 Dataset
            target dataset for region reference copy
    key : String
            Name of attribute in h5_source that contains
            the Region Reference to copy

    Returns
    -------
    ref_inds : Nx2x2 array of unsigned integers
            Array containing pairs of points that define
            the corners of each hyperslab in the region
            reference

    
Copies a region reference from one dataset to another
without alteration

Parameters

h5_source : HDF5 Dataset
source dataset for region reference copy
h5_target : HDF5 Dataset
target dataset for region reference copy
key : String
Name of attribute in h5_source that contains
the Region Reference to copy

Returns

ref_inds : Nx2x2 array of unsigned integers
Array containing pairs of points that define
the corners of each hyperslab in the region
reference
Copies a region reference from one dataset to another without alteration Parameters h5_source : HDF5 Dataset source dataset for region reference copy h5_target : HDF5 Dataset target dataset for region reference copy key : String Name of attribute in h5_source that contains the Region Reference to copy Returns ref_inds : Nx2x2 array of unsigned integers Array containing pairs of points that define the corners of each hyperslab in the region reference
def simple_region_ref_copy(h5_source, h5_target, key):
    for param, param_name in zip([h5_source, h5_target],
                                 ['h5_source', 'h5_target']):
        if not isinstance(param, h5py.Dataset):
            raise TypeError(param_name + ' should be a h5py.Dataset object')
    if not isinstance(key, (str, unicode)):
        raise TypeError('key should be a string')
    ref = h5_source.attrs[key]
    ref_inds = get_indices_for_region_ref(h5_source, ref,
                                          return_method='corners')
    ref_inds = ref_inds.reshape([-1, 2, 2])
    ref_inds[:, 1, 1] = h5_target.shape[1] - 1
    target_ref = create_region_reference(h5_target, ref_inds)
    h5_target.attrs[key] = target_ref
    return ref_inds
def simple_region_ref_copy ( h5_source , h5_target , key ) : for param , param_name in zip ( [ h5_source , h5_target ] , [ 'h5_source' , 'h5_target' ] ) : if not isinstance ( param , h5py . Dataset ) : raise TypeError ( param_name + ' should be a h5py.Dataset object' ) if not isinstance ( key , ( str , unicode ) ) : raise TypeError ( 'key should be a string' ) ref = h5_source . attrs [ key ] ref_inds = get_indices_for_region_ref ( h5_source , ref , return_method = 'corners' ) ref_inds = ref_inds . reshape ( [ - 1 , 2 , 2 ] ) ref_inds [ : , 1 , 1 ] = h5_target . shape [ 1 ] - 1 target_ref = create_region_reference ( h5_target , ref_inds ) h5_target . attrs [ key ] = target_ref return ref_inds
Copies a region reference from one dataset to another
without alteration
Copies a region reference from one dataset to another without alteration
"""
    Copies a region reference from one dataset to another
    without alteration

    Parameters
    ----------
    h5_source : HDF5 Dataset
            source dataset for region reference copy
    h5_target : HDF5 Dataset
            target dataset for region reference copy
    key : String
            Name of attribute in h5_source that contains
            the Region Reference to copy

    Returns
    -------
    ref_inds : Nx2x2 array of unsigned integers
            Array containing pairs of points that define
            the corners of each hyperslab in the region
            reference

    """
h5_source
h5_target
key