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


Python ImagesLoader.fromOCP方法代码示例

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


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

示例1: loadImagesOCP

# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import fromOCP [as 别名]
    def loadImagesOCP(
        self, bucketName, resolution, server="ocp.me", startIdx=None, stopIdx=None, minBound=None, maxBound=None
    ):
        """
        Load Images from OCP (Open Connectome Project).

        The OCP is a web service for access to EM brain images and other neural image data.
        The web-service can be accessed at http://www.openconnectomeproject.org/.
        
        Parameters
        ----------
        bucketName: string
            Token name for the project in OCP. This name should exist on the server from which data is loaded.

        resolution: nonnegative int
            Resolution of the data in OCP

        server: string, optional, default = 'ocp.me'
            Name of the OCP server with the specified token.
        
        startIdx: nonnegative int, optional, default = None
            Convenience parameters to read only a subset of input files. Uses python slice conventions
            (zero-based indexing with exclusive final position).

        stopIdx: nonnegative int, optional
            See startIdx.
        
        minBound, maxBound: tuple of nonnegative int, optional, default = None
            X,Y,Z bounds of the data to fetch from OCP. minBound contains the (xMin,yMin,zMin) while
            maxBound contains (xMax,yMax,zMax).

        Returns
        -------
        data: thunder.rdds.Images
             An Images object, wrapping an RDD of with (int) : (numpy array) pairs
        """

        from thunder.rdds.fileio.imagesloader import ImagesLoader

        loader = ImagesLoader(self._sc)

        # Checking StartIdx is smaller or equal to StopIdx
        if startIdx is not None and stopIdx is not None and startIdx > stopIdx:
            raise Exception("Error. startIdx {} is larger than stopIdx {}".format(startIdx, stopIdx))
        data = loader.fromOCP(
            bucketName,
            resolution=resolution,
            server=server,
            startIdx=startIdx,
            stopIdx=stopIdx,
            minBound=minBound,
            maxBound=maxBound,
        )

        return data
开发者ID:CICCIOSGAMINO,项目名称:thunder,代码行数:57,代码来源:context.py


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