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


Python DCEModality.get_pdf_list方法代码示例

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


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

示例1: test_dce_get_pdf_roi

# 需要导入模块: from protoclass.data_management import DCEModality [as 别名]
# 或者: from protoclass.data_management.DCEModality import get_pdf_list [as 别名]
def test_dce_get_pdf_roi():
    """Test the function to get a pdf from ROI."""

    # Load the data with only a single serie
    currdir = os.path.dirname(os.path.abspath(__file__))
    path_data = os.path.join(currdir, 'data', 'dce_folders')
    # Create the list of path
    path_data_list = [os.path.join(path_data, 's_2'),
                      os.path.join(path_data, 's_1')]
    # Create an object to handle the data
    dce_mod = DCEModality()

    dce_mod.read_data_from_path(path_data_list)

    # Create ground truth array
    pos = np.ones((368, 448), dtype=bool)
    neg = np.zeros((368, 448), dtype=bool)
    gt_index = np.rollaxis(np.array([neg, pos, pos, pos, neg]), 0, 3)

    # Compute the histgram for the required data
    pdf, bins = dce_mod.get_pdf_list(roi_data=(gt_index))

    pdf_roi = np.load(os.path.join(currdir, 'data', 'pdf_roi.npy'))
    bins_roi = np.load(os.path.join(currdir, 'data', 'bins_roi.npy'))

    for pdf_s, bins_s, pdf_gt, bins_gt in zip(pdf, bins,
                                              pdf_roi, bins_roi):
        assert_array_equal(pdf_s, pdf_gt)
        assert_array_equal(bins_s, bins_gt)
开发者ID:glemaitre,项目名称:protoclass,代码行数:31,代码来源:test_dce_modality.py

示例2: test_dce_get_pdf_wt_roi

# 需要导入模块: from protoclass.data_management import DCEModality [as 别名]
# 或者: from protoclass.data_management.DCEModality import get_pdf_list [as 别名]
def test_dce_get_pdf_wt_roi():
    """Test the function to get a pdf wihtout ROI."""

    # Load the data with only a single serie
    currdir = os.path.dirname(os.path.abspath(__file__))
    path_data = os.path.join(currdir, 'data', 'dce_folders')
    # Create the list of path
    path_data_list = [os.path.join(path_data, 's_2'),
                      os.path.join(path_data, 's_1')]
    # Create an object to handle the data
    dce_mod = DCEModality()

    dce_mod.read_data_from_path(path_data_list)

    # Compute the histgram for the required data
    pdf, bins = dce_mod.get_pdf_list()

    for pdf_s, bins_s, pdf_gt, bins_gt in zip(pdf, bins,
                                              dce_mod.pdf_series_,
                                              dce_mod.bin_series_):
        assert_array_equal(pdf_s, pdf_gt)
        assert_array_equal(bins_s, bins_gt)
开发者ID:glemaitre,项目名称:protoclass,代码行数:24,代码来源:test_dce_modality.py


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