本文整理汇总了Python中thunder.rdds.fileio.imagesloader.ImagesLoader.planes方法的典型用法代码示例。如果您正苦于以下问题:Python ImagesLoader.planes方法的具体用法?Python ImagesLoader.planes怎么用?Python ImagesLoader.planes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thunder.rdds.fileio.imagesloader.ImagesLoader
的用法示例。
在下文中一共展示了ImagesLoader.planes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_planes
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import planes [as 别名]
def test_planes(self):
dims = (2, 2, 4)
sz = reduce(lambda x, y: x * y, dims)
origAry = arange(sz, dtype=dtypeFunc("int16")).reshape(dims)
imageData = ImagesLoader(self.sc).fromArrays([origAry])
planedData = imageData.planes(0, 2)
planed = planedData.collect()[0][1]
expected = squeeze(origAry[slice(None), slice(None), slice(0, 2)])
assert_true(array_equal(expected, planed))
assert_equals(tuple(expected.shape), planedData._dims.count)
assert_equals(str(expected.dtype), planedData._dtype)
示例2: test_planes
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import planes [as 别名]
def test_planes(self):
# params are images shape, bottom, top, inclusize, expected slices of orig ary
PARAMS = [((2, 2, 4), 1, 2, True, [slice(None), slice(None), slice(1, 3)]),
((2, 2, 4), 0, 2, False, [slice(None), slice(None), slice(1, 2)])]
for params in PARAMS:
sz = reduce(lambda x, y: x*y, params[0])
origAry = arange(sz, dtype='int16').reshape(params[0])
imageData = ImagesLoader(self.sc).fromArrays([origAry])
planedData = imageData.planes(params[1], params[2], params[3])
planed = planedData.collect()
expected = squeeze(origAry[params[4]])
assert_true(array_equal(expected, planed[0][1]))
assert_equals(tuple(expected.shape), planedData._dims.count)
assert_equals(str(expected.dtype), planedData._dtype)