def ExportDojoFiles(self): ## fname = QFileDialog.getExistingDirectory(self, "Select Export Folder", self.u_info.files_path) if len(fname) == 0: print('No folder was selected.') return ## dir = fname + os.sep + 'dojo' print('Export folder: ', dir) tmp_info = Params() tmp_info.SetUserInfo(dir) print(tmp_info.files_path) print(tmp_info.ids_path) print(tmp_info.tile_ids_path) print(tmp_info.tile_ids_volume_file) print(tmp_info.color_map_file) print(tmp_info.segment_info_db_file) print(tmp_info.images_path) print(tmp_info.tile_images_path) print(tmp_info.tile_images_volume_file) os.mkdir(tmp_info.files_path) copy_tree(self.u_info.ids_path, tmp_info.ids_path) copy_tree(self.u_info.images_path, tmp_info.images_path)
def CheckFolderDojo(self, folder_path): tmp_info = Params() tmp_info.SetUserInfo(folder_path) # Check file existence if os.path.exists(tmp_info.files_path) and \ os.path.exists(tmp_info.ids_path) and \ os.path.exists(tmp_info.tile_ids_path) and \ os.path.isfile(tmp_info.tile_ids_volume_file) and \ os.path.isfile(tmp_info.color_map_file) and \ os.path.isfile(tmp_info.segment_info_db_file) and \ os.path.exists(tmp_info.images_path) and \ os.path.exists(tmp_info.tile_images_path) and \ os.path.isfile(tmp_info.tile_images_volume_file) : return 1 else: return 0