gbeflow/__init__.py
def read_hyperstack(fpath,dataset='channel1',tmax=166): 
    '''
    Read in an hdf5 hyperstack where each timepoint is a group
    containing two channels which are saved as datapoints

    .. warning:: Doesn't work on files that were written with :func:`write_hyperstack`. Tiff files are probably better.

    Parameters
    -----------
    fpath : str
        Relative or absolute path to data file
    dataset : str, optional
        Default = 'channel1'
        Specifies the key to select a dataset from the h5 file
    tmax : int, optional
        Default = 166
        Number of expected time frames

    Returns
    --------
    np.array
        Array with h5 data in dimensions txy
    '''
    
    # Open file object
    f = h5py.File(fpath,'r')
    
    # Retrieve each timepoint from file object
    L = []
    for t in range(tmax+1):
        try:
            L.append(np.array(f.get('t'+str(t)).get(dataset)))
        except:
            print('No data at time',t)
            
    # Close h5 file
    f.close()
        
    # Join all timepoints into a single numpy array to return
    return(np.stack(L))

    Read in an hdf5 hyperstack where each timepoint is a group
    containing two channels which are saved as datapoints

    .. warning:: Doesn't work on files that were written with :func:`write_hyperstack`. Tiff files are probably better.

    Parameters
    -----------
    fpath : str
        Relative or absolute path to data file
    dataset : str, optional
        Default = 'channel1'
        Specifies the key to select a dataset from the h5 file
    tmax : int, optional
        Default = 166
        Number of expected time frames

    Returns
    --------
    np.array
        Array with h5 data in dimensions txy
    
Read in an hdf5 hyperstack where each timepoint is a group
containing two channels which are saved as datapoints

: Doesn't work on files that were written with :func:`write_hyperstack`. Tiff files are probably better.

Parameters

fpath : str
Relative or absolute path to data file
dataset : str, optional
Default = 'channel1'
Specifies the key to select a dataset from the h5 file
tmax : int, optional
Default = 166
Number of expected time frames

Returns

np.array
Array with h5 data in dimensions txy
Read in an hdf5 hyperstack where each timepoint is a group containing two channels which are saved as datapoints : Doesn ' t work on files that were written with : func : ` write_hyperstack ` . Tiff files are probably better . Parameters fpath : str Relative or absolute path to data file dataset : str optional Default = ' channel1 ' Specifies the key to select a dataset from the h5 file tmax : int optional Default = 166 Number of expected time frames Returns np . array Array with h5 data in dimensions txy
def read_hyperstack(fpath,dataset='channel1',tmax=166): 
    f = h5py.File(fpath,'r')
    L = []
    for t in range(tmax+1):
        try:
            L.append(np.array(f.get('t'+str(t)).get(dataset)))
        except:
            print('No data at time',t)
    f.close()
    return(np.stack(L))
def read_hyperstack ( fpath , dataset = 'channel1' , tmax = 166 ) : f = h5py . File ( fpath , 'r' ) L = [ ] for t in range ( tmax + 1 ) : try : L . append ( np . array ( f . get ( 't' + str ( t ) ) . get ( dataset ) ) ) except : print ( 'No data at time' , t ) f . close ( ) return ( np . stack ( L ) )
Read in an hdf5 hyperstack where each timepoint is a group
containing two channels which are saved as datapoints
Read in an hdf5 hyperstack where each timepoint is a group containing two channels which are saved as datapoints
'''
    Read in an hdf5 hyperstack where each timepoint is a group
    containing two channels which are saved as datapoints

    .. warning:: Doesn't work on files that were written with :func:`write_hyperstack`. Tiff files are probably better.

    Parameters
    -----------
    fpath : str
        Relative or absolute path to data file
    dataset : str, optional
        Default = 'channel1'
        Specifies the key to select a dataset from the h5 file
    tmax : int, optional
        Default = 166
        Number of expected time frames

    Returns
    --------
    np.array
        Array with h5 data in dimensions txy
    ''' # Open file object # Retrieve each timepoint from file object # Close h5 file # Join all timepoints into a single numpy array to return
fpath
dataset
tmax