本文整理汇总了Python中ilastik.applets.dataSelection.opDataSelection.DatasetInfo.realDataSource方法的典型用法代码示例。如果您正苦于以下问题:Python DatasetInfo.realDataSource方法的具体用法?Python DatasetInfo.realDataSource怎么用?Python DatasetInfo.realDataSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilastik.applets.dataSelection.opDataSelection.DatasetInfo
的用法示例。
在下文中一共展示了DatasetInfo.realDataSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fake_data_source
# 需要导入模块: from ilastik.applets.dataSelection.opDataSelection import DatasetInfo [as 别名]
# 或者: from ilastik.applets.dataSelection.opDataSelection.DatasetInfo import realDataSource [as 别名]
def test_fake_data_source(self):
graph = lazyflow.graph.Graph()
reader = OperatorWrapper(OpDataSelection, graph=graph,
operator_kwargs={'forceAxisOrder': False})
reader.ProjectFile.setValue(self.projectFile)
reader.WorkingDirectory.setValue(os.getcwd())
reader.ProjectDataGroup.setValue('DataSelection/local_data')
info = DatasetInfo()
# Will be read from the filesystem since the data won't be found in the project file.
info.location = DatasetInfo.Location.ProjectInternal
info.filePath = self.testRawDataFileName
info.internalPath = ""
info.invertColors = False
info.convertToGrayscale = False
# Use *fake* data source
info.realDataSource = False
info.axistags = vigra.defaultAxistags('tczyx')
info.laneShape = self.imgData.shape
info.laneDtype = self.imgData.dtype
reader.Dataset.setValues([info])
# Verify that now data selection operator returns fake data
# with expected shape and type
imgData = reader.Image[0][...].wait()
assert imgData.shape == self.imgData.shape
assert imgData.dtype == self.imgData.dtype
expected_fake_data = numpy.zeros(info.laneShape, dtype=info.laneDtype)
numpy.testing.assert_array_equal(imgData, expected_fake_data)
示例2: test_real_data_source
# 需要导入模块: from ilastik.applets.dataSelection.opDataSelection import DatasetInfo [as 别名]
# 或者: from ilastik.applets.dataSelection.opDataSelection.DatasetInfo import realDataSource [as 别名]
def test_real_data_source(self):
graph = lazyflow.graph.Graph()
reader = OperatorWrapper(OpDataSelection, graph=graph,
operator_kwargs={'forceAxisOrder': False})
reader.ProjectFile.setValue(self.projectFile)
reader.WorkingDirectory.setValue(os.getcwd())
reader.ProjectDataGroup.setValue('DataSelection/local_data')
info = DatasetInfo()
# Will be read from the filesystem since the data won't be found in the project file.
info.location = DatasetInfo.Location.ProjectInternal
info.filePath = self.testRawDataFileName
info.internalPath = ""
info.invertColors = False
info.convertToGrayscale = False
#Use real data source
info.realDataSource = True
reader.Dataset.setValues([info])
# Read the test file using the data selection operator and verify the contents
imgData = reader.Image[0][...].wait()
assert imgData.shape == self.imgData.shape
numpy.testing.assert_array_equal(imgData, self.imgData)