converters.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:fmrif_tools 作者: nih-fmrif 项目源码 文件源码
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.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号