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


Python img_plotting.plot_img函数代码示例

本文整理汇总了Python中nilearn.plotting.img_plotting.plot_img函数的典型用法代码示例。如果您正苦于以下问题:Python plot_img函数的具体用法?Python plot_img怎么用?Python plot_img使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_plot_with_axes_or_figure

def test_plot_with_axes_or_figure():
    img = _generate_img()
    figure = plt.figure()
    plot_img(img, figure=figure)

    ax = plt.subplot(111)
    plot_img(img, axes=ax)
开发者ID:amadeuskanaan,项目名称:nilearn,代码行数:7,代码来源:test_img_plotting.py

示例2: test_plot_empty_slice

def test_plot_empty_slice():
    # Test that things don't crash when we give a map with nothing above
    # threshold
    # This is only a smoke test
    data = np.zeros((20, 20, 20))
    img = nibabel.Nifti1Image(data, mni_affine)
    plot_img(img, display_mode='y', threshold=1)
开发者ID:amadeuskanaan,项目名称:nilearn,代码行数:7,代码来源:test_img_plotting.py

示例3: test_plot_img_with_auto_cut_coords

def test_plot_img_with_auto_cut_coords():
    data = np.zeros((20, 20, 20))
    data[3:-3, 3:-3, 3:-3] = 1
    img = nibabel.Nifti1Image(data, np.eye(4))

    for display_mode in "xyz":
        plot_img(img, cut_coords=None, display_mode=display_mode, black_bg=True)
开发者ID:agramfort,项目名称:nilearn,代码行数:7,代码来源:test_img_plotting.py

示例4: test_plot_with_axes_or_figure

def test_plot_with_axes_or_figure():
    img = _generate_img()
    figure = plt.figure()
    plot_img(img, figure=figure)

    ax = plt.subplot(111)
    plot_img(img, axes=ax)

    # Save execution time and memory
    plt.close()
开发者ID:AlexandreAbraham,项目名称:nilearn,代码行数:10,代码来源:test_img_plotting.py

示例5: test_plot_img_with_auto_cut_coords

def test_plot_img_with_auto_cut_coords():
    import matplotlib.pyplot as plt
    plt.switch_backend('template')
    data = np.zeros((20, 20, 20))
    data[3:-3, 3:-3, 3:-3] = 1
    img = nibabel.Nifti1Image(data, np.eye(4))

    for display_mode in 'xyz':
        plot_img(img, cut_coords=None, display_mode=display_mode,
                 black_bg=True)
开发者ID:fabianp,项目名称:nilearn,代码行数:10,代码来源:test_img_plotting.py

示例6: test_plot_empty_slice

def test_plot_empty_slice():
    # Test that things don't crash when we give a map with nothing above
    # threshold
    # This is only a smoke test
    mp.use('template', warn=False)
    import matplotlib.pyplot as plt
    plt.switch_backend('template')
    data = np.zeros((20, 20, 20))
    img = nibabel.Nifti1Image(data, mni_affine)
    plot_img(img, display_mode='y', threshold=1)
开发者ID:fabianp,项目名称:nilearn,代码行数:10,代码来源:test_img_plotting.py

示例7: test_plot_with_axes_or_figure

def test_plot_with_axes_or_figure():
    mp.use('template', warn=False)
    import matplotlib.pyplot as plt
    plt.switch_backend('template')
    img = _generate_img()
    figure = plt.figure()
    plot_img(img, figure=figure)

    ax = plt.subplot(111)
    plot_img(img, axes=ax)
开发者ID:fabianp,项目名称:nilearn,代码行数:10,代码来源:test_img_plotting.py

示例8: test_plot_img_with_auto_cut_coords

def test_plot_img_with_auto_cut_coords():
    data = np.zeros((20, 20, 20))
    data[3:-3, 3:-3, 3:-3] = 1
    img = nibabel.Nifti1Image(data, np.eye(4))

    for display_mode in 'xyz':
        plot_img(img, cut_coords=None, display_mode=display_mode,
                 black_bg=True)

        # Save execution time and memory
        plt.close()
开发者ID:AlexandreAbraham,项目名称:nilearn,代码行数:11,代码来源:test_img_plotting.py

示例9: test_display_methods_with_display_mode_tiled

def test_display_methods_with_display_mode_tiled():
    img = _generate_img()
    display = plot_img(img, display_mode='tiled')
    display.add_overlay(img, threshold=0)
    display.add_edges(img, color='c')
    display.add_contours(img, contours=2, linewidth=4,
                         colors=['limegreen', 'yellow'])
开发者ID:jeromedockes,项目名称:nilearn,代码行数:7,代码来源:test_img_plotting.py

示例10: test_display_methods

def test_display_methods():
    img = _generate_img()

    display = plot_img(img)
    display.add_overlay(img, threshold=0)
    display.add_edges(img, color="c")
    display.add_contours(img, contours=2, linewidth=4, colors=["limegreen", "yellow"])
开发者ID:agramfort,项目名称:nilearn,代码行数:7,代码来源:test_img_plotting.py

示例11: test_plot_img_with_resampling

def test_plot_img_with_resampling():
    data = _generate_img().get_data()
    affine = np.array([[1.0, -1.0, 0.0, 0.0], [1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])
    img = nibabel.Nifti1Image(data, affine)
    display = plot_img(img)
    display.add_overlay(img)
    display.add_contours(img, contours=2, linewidth=4, colors=["limegreen", "yellow"])
    display.add_edges(img, color="c")
开发者ID:KentChun33333,项目名称:nilearn,代码行数:8,代码来源:test_img_plotting.py

示例12: test_plot_img_with_resampling

def test_plot_img_with_resampling():
    data = _generate_img().get_data()
    affine = np.array([[1., -1.,  0.,  0.],
                       [1.,  1.,  0.,  0.],
                       [0.,  0.,  1.,  0.],
                       [0.,  0.,  0.,  1.]])
    img = nibabel.Nifti1Image(data, affine)
    display = plot_img(img)
    display.add_overlay(img)
开发者ID:DavidDJChen,项目名称:nilearn,代码行数:9,代码来源:test_img_plotting.py

示例13: test_plot_img_with_resampling

def test_plot_img_with_resampling():
    import matplotlib.pyplot as plt
    plt.switch_backend('template')
    data = _generate_img().get_data()
    affine = np.array([[1., -1.,  0.,  0.],
                       [1.,  1.,  0.,  0.],
                       [0.,  0.,  1.,  0.],
                       [0.,  0.,  0.,  1.]])
    img = nibabel.Nifti1Image(data, affine)
    display = plot_img(img)
    display.add_overlay(img)
开发者ID:fabianp,项目名称:nilearn,代码行数:11,代码来源:test_img_plotting.py

示例14: test_display_methods

def test_display_methods():
    mp.use('template', warn=False)
    import matplotlib.pyplot as plt
    plt.switch_backend('template')
    img = _generate_img()

    display = plot_img(img)
    display.add_overlay(img, threshold=0)
    display.add_edges(img, color='c')
    display.add_contours(img, contours=2, linewidth=4,
                         colors=['limegreen', 'yellow'])
开发者ID:fabianp,项目名称:nilearn,代码行数:11,代码来源:test_img_plotting.py

示例15: test_plot_img_with_resampling

def test_plot_img_with_resampling():
    data = _generate_img().get_data()
    affine = np.array([[1., -1.,  0.,  0.],
                       [1.,  1.,  0.,  0.],
                       [0.,  0.,  1.,  0.],
                       [0.,  0.,  0.,  1.]])
    img = nibabel.Nifti1Image(data, affine)
    display = plot_img(img)
    display.add_overlay(img)
    display.add_contours(img, contours=2, linewidth=4,
                         colors=['limegreen', 'yellow'])
    display.add_edges(img, color='c')

    # Save execution time and memory
    plt.close()
开发者ID:AlexandreAbraham,项目名称:nilearn,代码行数:15,代码来源:test_img_plotting.py


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