def get_MELC_files(self, path): files, _ = myF.get_files(path, ('tif', 'TIF')) files_pd = pd.DataFrame(files) files_pd = files_pd.rename(columns={0: "path"}) def get_FID(x): temp = x['path'].split(SEPARATOR) _temp = temp[len(temp) - 1].split('.')[0].split('_') return _temp[1] + '_' + _temp[2] + '_' + _temp[3] + '_' + _temp[4] def get_order_index(x): return int(x['path'].split(SEPARATOR)[-1].split('_')[-1][0:-4]) def get_filter(x): temp = x['path'].split(SEPARATOR)[-1].split('_') if len(temp) > 3: return temp[-2] else: return '' def get_integration_time(x): temp = x['path'].split(SEPARATOR)[-1].split('_') if len(temp) > 3: return int(temp[-3]) else: return 0 def get_antibody(x): return x['path'].split(SEPARATOR)[-1].split('_')[1] #def get_creation_time(x): #return x['path'].split(SEPARATOR)[-1].split('_')[0] files_pd = files_pd.rename(columns={0: "path"}) files_pd['fid'] = files_pd.apply(lambda x: get_FID(x), axis=1) files_pd['order_index'] = files_pd.apply(lambda x: get_order_index(x), axis=1) files_pd['filter'] = files_pd.apply(lambda x: get_filter(x), axis=1) files_pd['integration_time'] = files_pd.apply( lambda x: get_integration_time(x), axis=1) files_pd['antibody'] = files_pd.apply(lambda x: get_antibody(x), axis=1) #files_pd['creation_time'] = files_pd.apply(lambda x: get_creation_time(x), axis=1) return files_pd
def __init__(self, calib_path): files_tiff, _ = myF.get_files(calib_path, ('tif', 'TIF')) files_pd = pd.DataFrame(files_tiff) def get_FID(x): temp = x['path'].split(SEPARATOR) return temp[len(temp) - 1][11:-4] def get_order_index(x): return int(x['path'].split(SEPARATOR)[-1].split('_')[-1][0:-4]) def get_filter(x): temp = x['path'].split(SEPARATOR)[-1].split('_') if len(temp) > 3: return temp[-2] else: return '' def get_integration_time(x): temp = x['path'].split(SEPARATOR)[-1].split('_') if len(temp) > 3: return int(temp[-3]) else: return 0 def get_creation_time(x): return x['path'].split(SEPARATOR)[-1].split('_')[0] files_pd = files_pd.rename(columns={0: "path"}) files_pd['fid'] = files_pd.apply(lambda x: get_FID(x), axis=1) files_pd['order_index'] = files_pd.apply(lambda x: get_order_index(x), axis=1) files_pd['filter'] = files_pd.apply(lambda x: get_filter(x), axis=1) files_pd['integration_time'] = files_pd.apply( lambda x: get_integration_time(x), axis=1) files_pd['creation_time'] = files_pd.apply( lambda x: get_creation_time(x), axis=1) self.files_pd = files_pd
def get_dataFrame_MELCraw(self, path_raw_data): files_png, creation_times = myF.get_files(path_raw_data, ('png')) files_pd = pd.DataFrame(files_png) creation_times = pd.DataFrame(creation_times) return files_pd, creation_times