本文整理汇总了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)