def main(): folder = '20200831-mht' full_target = 'G:/FTP_IMPORTS' + '/' + folder #oak_target = 'X:/data/Brezovec/2P_Imaging/imports' #oak_target = 'X:/data/Ashley2/imports' oak_target = 'X:/data/Max/ImagingData/Bruker/imports' extensions_for_oak_transfer = ['.nii', '.csv', '.xml', 'json'] # last 4 chars flow.start_oak_transfer(full_target, oak_target, extensions_for_oak_transfer)
def main(): print('Starting download of fictrac and visual stim files.') ftp_host = ftputil.FTPHost(ip, username, passwd) all_fictrac_files = ftp_host.listdir(fictrac_source) # of the form: #fictrac-20181116_172030.log #fictrac-20181116_172038-debug.avi #fictrac-20181116_172038-raw.avi #fictrac-20181116_172030.dat # Should download all fictrac files # today = datetime.today().strftime('%Y%m%d') for file in all_fictrac_files: if file[-4:] in allowable_extensions: target_path = fictrac_target + '/' + file source_path = fictrac_source + '/' + file if os.path.isfile(target_path): print('File already exists. Skipping. {}'.format(target_path)) else: print('Downloading {}'.format(target_path)) ftp_host.download(source_path, target_path) # Copy from visual flow.start_copy_recursive_ftp(ftp_host, visual_source, visual_target, ip, username, passwd) # Send fictrac files to oak flow.start_oak_transfer(fictrac_target, oak_target, allowable_extensions=None, add_flag=False) # Send visual files to oak flow.start_oak_transfer(visual_target, oak_target, allowable_extensions=None, add_flag=False) print('Finished upload of fictrac and visual stim files to oak.')
def main(args): ''' mode options: tiff_to_nii, to_oak, tiff_to_nii_to_oak ''' mode = args[0] output = args[1] folder = args[2] #oak_target = 'X:/data/Brezovec/2P_Imaging/imports' oak_target = 'X:/data/Ashley2/imports' extensions_for_oak_transfer = ['.nii', '.csv', '.xml', 'json', 'tiff'] # needs to for 4 char full_target = os.path.join('F:/ftp_imports', folder) if mode == 'tiff_to_nii': flow.start_convert_tiff_collections(full_target) elif mode == 'to_oak': flow.start_oak_transfer(full_target, oak_target, extensions_for_oak_transfer) elif mode == 'tiff_to_nii_to_oak': if output == 'tiff': flow.convert_tiff_collections_to_stack(full_target) elif output == 'nii': flow.start_convert_tiff_collections(full_target) else: print('Invalid mode') flow.start_oak_transfer(full_target, oak_target, extensions_for_oak_transfer) elif mode == 'raw_to_oak': flow.convert_raw_to_tiff(full_target) flow.start_convert_tiff_collections(full_target) flow.start_oak_transfer(full_target, oak_target, extensions_for_oak_transfer) else: print('Invalid mode: {}'.format(mode)) print('Must be tiff_to_nii, to_oak, or tiff_to_nii_to_oak')
import dataflow as flow full_target = 'G:/ftp_imports/20200613' oak_target = 'X:/data/Brezovec/2P_Imaging/imports' #oak_target = 'X:/data/Ashley2/imports' extensions_for_oak_transfer = ['.nii', '.csv', '.xml', 'json'] # last 4 chars flow.convert_raw_to_tiff(full_target) ######################################### ### Convert tiff to nii or tiff stack ### ######################################### flow.start_convert_tiff_collections(full_target) ####################### ### Transfer to Oak ### ####################### flow.start_oak_transfer(full_target, oak_target, extensions_for_oak_transfer)