本文整理汇总了Python中protoclass.data_management.GTModality.is_read方法的典型用法代码示例。如果您正苦于以下问题:Python GTModality.is_read方法的具体用法?Python GTModality.is_read怎么用?Python GTModality.is_read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protoclass.data_management.GTModality
的用法示例。
在下文中一共展示了GTModality.is_read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_read_gt_data_path_list_constructor
# 需要导入模块: from protoclass.data_management import GTModality [as 别名]
# 或者: from protoclass.data_management.GTModality import is_read [as 别名]
def test_read_gt_data_path_list_constructor():
""" Test if we can read gt series. """
# Load the data with only a single serie
currdir = os.path.dirname(os.path.abspath(__file__))
path_data = os.path.join(currdir, 'data', 'gt_folders')
path_data_list = [os.path.join(path_data, 'prostate'),
os.path.join(path_data, 'cg'),
os.path.join(path_data, 'pz'),
os.path.join(path_data, 'cap')]
# Give the list for the ground_truth
label = ['prostate', 'cg', 'pz', 'cap']
# Create an object to handle the data
gt_mod = GTModality(path_data_list)
# Check that the data have been read
assert_true(not gt_mod.is_read())
gt_mod.read_data_from_path(label)
# Check that the data have been read
assert_true(gt_mod.is_read())
# Check the data here
data = np.load(os.path.join(currdir, 'data', 'gt_path_list.npy'))
assert_array_equal(gt_mod.data_, data)
assert_equal(gt_mod.n_serie_, 4)