def map_to_bids(self, bids_map, bids_dir, dicom_dir, biopac_dir, nthreads, overwrite):
# Parse bids_map csv table, and create execution list for BIDS generation
mapping = pd.read_csv(bids_map, header=0, index_col=None)
mapping.replace(np.nan, '', regex=True, inplace=True)
with ThreadPoolExecutor(max_workers=nthreads) as executor:
futures = []
for _, row in mapping.iterrows():
futures.append(executor.submit(self._process_map_row, row, bids_dir, dicom_dir, self.conversion_tool,
biopac_dir, overwrite))
success = True
for future in as_completed(futures):
if not future.result():
success = False
break
if not success:
self.log.error("There were errors converting the provided datasets to BIDS format. See log for more"
" information.")
评论列表
文章目录