当前位置: 首页>>代码示例>>Python>>正文


Python DataSelectionApplet.create_default_headless_dataset_info方法代码示例

本文整理汇总了Python中ilastik.applets.dataSelection.DataSelectionApplet.create_default_headless_dataset_info方法的典型用法代码示例。如果您正苦于以下问题:Python DataSelectionApplet.create_default_headless_dataset_info方法的具体用法?Python DataSelectionApplet.create_default_headless_dataset_info怎么用?Python DataSelectionApplet.create_default_headless_dataset_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilastik.applets.dataSelection.DataSelectionApplet的用法示例。


在下文中一共展示了DataSelectionApplet.create_default_headless_dataset_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _run_export_with_empty_batch_lane

# 需要导入模块: from ilastik.applets.dataSelection import DataSelectionApplet [as 别名]
# 或者: from ilastik.applets.dataSelection.DataSelectionApplet import create_default_headless_dataset_info [as 别名]
    def _run_export_with_empty_batch_lane(self, role_input_paths, batch_lane_index, template_infos, progress_callback):
        """
        Configure the fresh batch lane with the given input files, and export the results.
        """
        assert role_input_paths[0], "At least one file must be provided for each dataset (the first role)."
        opDataSelectionBatchLaneView = self.dataSelectionApplet.topLevelOperator.getLane( batch_lane_index )

        # Apply new settings for each role
        for role_index, path_for_role in enumerate(role_input_paths):
            if not path_for_role:
                continue

            if template_infos[role_index]:
                info = copy.copy(template_infos[role_index])
            else:
                info = DatasetInfo()

            # Override the template settings with the current filepath.
            default_info = DataSelectionApplet.create_default_headless_dataset_info(path_for_role)
            info.filePath = default_info.filePath
            info.location = default_info.location
            info.nickname = default_info.nickname

            # Apply to the data selection operator
            opDataSelectionBatchLaneView.DatasetGroup[role_index].setValue(info)

        # Make sure nothing went wrong
        opDataExportBatchlaneView = self.dataExportApplet.topLevelOperator.getLane( batch_lane_index )
        assert opDataExportBatchlaneView.ImageToExport.ready()
        assert opDataExportBatchlaneView.ExportPath.ready()
        
        # New lanes were added.
        # Give the workflow a chance to restore anything that was unecessarily invalidated (e.g. classifiers)
        self.workflow.handleNewLanesAdded()
        
        # Call customization hook
        self.dataExportApplet.prepare_lane_for_export(batch_lane_index)

        # Finally, run the export
        logger.info("Exporting to {}".format( opDataExportBatchlaneView.ExportPath.value ))
        opDataExportBatchlaneView.progressSignal.subscribe(progress_callback)
        opDataExportBatchlaneView.run_export()

        # Call customization hook
        self.dataExportApplet.post_process_lane_export(batch_lane_index)
开发者ID:slzephyr,项目名称:ilastik,代码行数:47,代码来源:batchProcessingApplet.py


注:本文中的ilastik.applets.dataSelection.DataSelectionApplet.create_default_headless_dataset_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。