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


Python DatasetInfo.sequenceAxis方法代码示例

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


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

示例1: _get_template_dataset_infos

# 需要导入模块: from ilastik.applets.dataSelection.opDataSelection import DatasetInfo [as 别名]
# 或者: from ilastik.applets.dataSelection.opDataSelection.DatasetInfo import sequenceAxis [as 别名]
    def _get_template_dataset_infos(self, input_axes=None, sequence_axis=None):
        """
        Sometimes the default settings for an input file are not suitable (e.g. the axistags need to be changed).
        We assume the LAST non-batch input in the workflow has settings that will work for all batch processing inputs.
        Here, we get the DatasetInfo objects from that lane and store them as 'templates' to modify for all batch-
        processing files.
        """
        template_infos = {}

        # If there isn't an available dataset to use as a template
        if len(self.dataSelectionApplet.topLevelOperator.DatasetGroup) == 0:
            num_roles = len(
                self.dataSelectionApplet.topLevelOperator.DatasetRoles.value)
            for role_index in range(num_roles):
                template_infos[role_index] = DatasetInfo()
                if input_axes:
                    template_infos[role_index].axistags = vigra.defaultAxistags(
                        input_axes)
                if sequence_axis:
                    template_infos[role_index].sequenceAxis = sequence_axis
            return template_infos

        # Use the LAST non-batch input file as our 'template' for DatasetInfo settings (e.g. axistags)
        template_lane = len(
            self.dataSelectionApplet.topLevelOperator.DatasetGroup) - 1
        opDataSelectionTemplateView = self.dataSelectionApplet.topLevelOperator.getLane(
            template_lane)

        for role_index, info_slot in enumerate(opDataSelectionTemplateView.DatasetGroup):
            if info_slot.ready():
                template_infos[role_index] = info_slot.value
            else:
                template_infos[role_index] = DatasetInfo()
            if input_axes:
                # Support the --input_axes arg to override input axis order, same as DataSelection applet.
                template_infos[role_index].axistags = vigra.defaultAxistags(
                    input_axes)
            if sequence_axis:
                template_infos[role_index].sequenceAxis = sequence_axis
        return template_infos
开发者ID:ilastik,项目名称:ilastik,代码行数:42,代码来源:batchProcessingApplet.py


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