ct_segnet/data_utils/data_io.py
def read_tiffseq(userfilepath = '', procs = None, s = None):
    """Read a sequence of tiff images from folder.
    userfilepath : path to folder containing images
    s            : s is either a slice(start, stop, step) or a list of indices to be read  
    """
    if not userfilepath:
        raise ValueError("File path is required.")
        return []

    if procs == None:
        procs = cpu_count()
        
    ImgFileList = sorted(glob.glob(userfilepath+'/*.tif'))
    
    if not ImgFileList: ImgFileList = sorted(glob.glob(userfilepath+'/*.tiff'))
    
    if s != None:
        if type(s) == slice:
            ImgFileList = ImgFileList[s]
        elif type(s) == list:
            ImgFileList = [ImgFileList[i] for i in s]
        else:
            raise ValueError("s input not recognized.")
    
    S = Parallelize(ImgFileList, imread, procs = procs)

    return S
Read a sequence of tiff images from folder.
    userfilepath : path to folder containing images
    s            : s is either a slice(start, stop, step) or a list of indices to be read  
    
Read a sequence of tiff images from folder.
userfilepath : path to folder containing images
s            : s is either a slice(start, stop, step) or a list of indices to be read
Read a sequence of tiff images from folder . userfilepath : path to folder containing images s : s is either a slice ( start stop step ) or a list of indices to be read
def read_tiffseq(userfilepath = '', procs = None, s = None):
    if not userfilepath:
        raise ValueError("File path is required.")
        return []
    if procs == None:
        procs = cpu_count()
    ImgFileList = sorted(glob.glob(userfilepath+'/*.tif'))
    if not ImgFileList: ImgFileList = sorted(glob.glob(userfilepath+'/*.tiff'))
    if s != None:
        if type(s) == slice:
            ImgFileList = ImgFileList[s]
        elif type(s) == list:
            ImgFileList = [ImgFileList[i] for i in s]
        else:
            raise ValueError("s input not recognized.")
    S = Parallelize(ImgFileList, imread, procs = procs)
    return S
def read_tiffseq ( userfilepath = '' , procs = None , s = None ) : if not userfilepath : raise ValueError ( "File path is required." ) return [ ] if procs == None : procs = cpu_count ( ) ImgFileList = sorted ( glob . glob ( userfilepath + '/*.tif' ) ) if not ImgFileList : ImgFileList = sorted ( glob . glob ( userfilepath + '/*.tiff' ) ) if s != None : if type ( s ) == slice : ImgFileList = ImgFileList [ s ] elif type ( s ) == list : ImgFileList = [ ImgFileList [ i ] for i in s ] else : raise ValueError ( "s input not recognized." ) S = Parallelize ( ImgFileList , imread , procs = procs ) return S
Read a sequence of tiff images from folder.
Read a sequence of tiff images from folder .
"""Read a sequence of tiff images from folder.
    userfilepath : path to folder containing images
    s            : s is either a slice(start, stop, step) or a list of indices to be read  
    """
userfilepath
procs
s