viz
viz.app
viz.panel
viz.projections
viz.regtools
Horizon
Streamlines
viz
fetch_viz_icons () |
Download icons for fury |
optional_package (name[, trip_msg]) |
Return package-like thing and module setup for package name |
read_viz_icons ([style, fname]) |
Read specific icon from specific style. |
viz.app
Horizon (tractograms, images, cluster, …[, …]) |
Methods |
Streamlines |
alias of nibabel.streamlines.array_sequence.ArraySequence |
apply_shader (hz, actor) |
|
build_label (text[, font_size, bold]) |
Simple utility function to build labels |
horizon (tractograms, images, cluster, …[, …]) |
Highly interactive visualization - invert the Horizon! |
length |
Euclidean length of streamlines |
optional_package (name[, trip_msg]) |
Return package-like thing and module setup for package name |
qbx_and_merge (streamlines, thresholds[, …]) |
Run QuickBundlesX and then run again on the centroids of the last layer |
setup_module () |
|
slicer_panel (renderer[, data, affine, …]) |
Slicer panel with slicer included |
viz.panel
build_label (text[, font_size, bold]) |
Simple utility function to build labels |
optional_package (name[, trip_msg]) |
Return package-like thing and module setup for package name |
setup_module () |
|
slicer_panel (renderer[, data, affine, …]) |
Slicer panel with slicer included |
viz.projections
Visualization tools for 2D projections of 3D functions on the sphere, such as ODFs.
doctest_skip_parser (func) |
Decorator replaces custom skip test markup in doctests. |
optional_package (name[, trip_msg]) |
Return package-like thing and module setup for package name |
setup_module () |
|
sph_project (vertices, val[, ax, vmin, vmax, …]) |
Draw a signal on a 2D projection of the sphere. |
viz.regtools
draw_lattice_2d (nrows, ncols, delta) |
Create a regular lattice of nrows x ncols squares. |
optional_package (name[, trip_msg]) |
Return package-like thing and module setup for package name |
overlay_images (img0, img1[, title0, …]) |
Plot two images one on top of the other using red and green channels. |
overlay_slices (L, R[, slice_index, …]) |
Plot three overlaid slices from the given volumes. |
plot_2d_diffeomorphic_map (mapping[, delta, …]) |
Draw the effect of warping a regular lattice by a diffeomorphic map. |
plot_slices (V[, slice_indices, fname]) |
Plot 3 slices from the given volume: 1 sagital, 1 coronal and 1 axial |
setup_module () |
|
simple_plot (file_name, title, x, y, xlabel, …) |
Saves the simple plot with given x and y values |
dipy.viz.
optional_package
(name, trip_msg=None)Return package-like thing and module setup for package name
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.
read_viz_icons
(style='icomoon', fname='infinity.png')Read specific icon from specific style.
Parameters: |
|
---|---|
Returns: |
|
Horizon
dipy.viz.app.
Horizon
(tractograms, images, cluster, cluster_thr, random_colors, length_lt, length_gt, clusters_lt, clusters_gt, world_coords=True, interactive=True, out_png='tmp.png')Bases: object
Methods
build_scene | |
build_show |
__init__
(tractograms, images, cluster, cluster_thr, random_colors, length_lt, length_gt, clusters_lt, clusters_gt, world_coords=True, interactive=True, out_png='tmp.png')Highly interactive visualization - invert the Horizon!
Parameters: |
|
---|
References
[Horizon_ISMRM19] | Garyfallidis E., M-A. Cote, B.Q. Chandio, S. Fadnavis, J. Guaje, R. Aggarwal, E. St-Onge, K.S. Juneja, S. Koudoro, D. Reagan, DIPY Horizon: fast, modular, unified and adaptive visualization, Proceedings of: International Society of Magnetic Resonance in Medicine (ISMRM), Montreal, Canada, 2019. |
dipy.viz.app.
horizon
(tractograms, images, cluster, cluster_thr, random_colors, length_lt, length_gt, clusters_lt, clusters_gt, world_coords=True, interactive=True, out_png='tmp.png')Highly interactive visualization - invert the Horizon!
Parameters: |
|
---|
References
[Horizon_ISMRM19] | Garyfallidis E., M-A. Cote, B.Q. Chandio, S. Fadnavis, J. Guaje, R. Aggarwal, E. St-Onge, K.S. Juneja, S. Koudoro, D. Reagan, DIPY Horizon: fast, modular, unified and adaptive visualization, Proceedings of: International Society of Magnetic Resonance in Medicine (ISMRM), Montreal, Canada, 2019. |
dipy.viz.app.
length
()Euclidean length of streamlines
Length is in mm only if streamlines are expressed in world coordinates.
Parameters: |
|
---|---|
Returns: |
|
Examples
>>> from dipy.tracking.streamline import length
>>> import numpy as np
>>> streamline = np.array([[1, 1, 1], [2, 3, 4], [0, 0, 0]])
>>> expected_length = np.sqrt([1+2**2+3**2, 2**2+3**2+4**2]).sum()
>>> length(streamline) == expected_length
True
>>> streamlines = [streamline, np.vstack([streamline, streamline[::-1]])]
>>> expected_lengths = [expected_length, 2*expected_length]
>>> lengths = [length(streamlines[0]), length(streamlines[1])]
>>> np.allclose(lengths, expected_lengths)
True
>>> length([])
0.0
>>> length(np.array([[1, 2, 3]]))
0.0
dipy.viz.app.
optional_package
(name, trip_msg=None)Return package-like thing and module setup for package name
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.app.
qbx_and_merge
(streamlines, thresholds, nb_pts=20, select_randomly=None, rng=None, verbose=True)Run QuickBundlesX and then run again on the centroids of the last layer
Running again QuickBundles at a layer has the effect of merging some of the clusters that maybe originally devided because of branching. This function help obtain a result at a QuickBundles quality but with QuickBundlesX speed. The merging phase has low cost because it is applied only on the centroids rather than the entire dataset.
Parameters: |
|
---|---|
Returns: |
|
References
[Garyfallidis12] | Garyfallidis E. et al., QuickBundles a method for tractography simplification, Frontiers in Neuroscience, vol 6, no 175, 2012. |
[Garyfallidis16] | Garyfallidis E. et al. QuickBundlesX: Sequential clustering of millions of streamlines in multiple levels of detail at record execution time. Proceedings of the, International Society of Magnetic Resonance in Medicine (ISMRM). Singapore, 4187, 2016. |
dipy.viz.panel.
optional_package
(name, trip_msg=None)Return package-like thing and module setup for package name
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.projections.
doctest_skip_parser
(func)Decorator replaces custom skip test markup in doctests.
Say a function has a docstring:
>>> something # skip if not HAVE_AMODULE
>>> something + else
>>> something # skip if HAVE_BMODULE
This decorator will evaluate the expresssion after skip if
. If this
evaluates to True, then the comment is replaced by # doctest: +SKIP
.
If False, then the comment is just removed. The expression is evaluated in
the globals
scope of func.
For example, if the module global HAVE_AMODULE
is False, and module
global HAVE_BMODULE
is False, the returned function will have
docstring:
>>> something
>>> something + else
>>> something
dipy.viz.projections.
optional_package
(name, trip_msg=None)Return package-like thing and module setup for package name
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.projections.
sph_project
(vertices, val, ax=None, vmin=None, vmax=None, cmap=None, cbar=True, tri=False, boundary=False, **basemap_args)Draw a signal on a 2D projection of the sphere.
Parameters: |
|
---|---|
Returns: |
|
Examples
>>> from dipy.data import get_sphere
>>> verts = get_sphere('symmetric724').vertices
>>> ax = sph_project(verts.T, np.random.rand(len(verts.T)))
dipy.viz.regtools.
draw_lattice_2d
(nrows, ncols, delta)Create a regular lattice of nrows x ncols squares.
Creates an image (2D array) of a regular lattice of nrows x ncols squares. The size of each square is delta x delta pixels (not counting the separation lines). The lines are one pixel width.
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.regtools.
optional_package
(name, trip_msg=None)Return package-like thing and module setup for package name
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.regtools.
overlay_images
(img0, img1, title0='', title_mid='', title1='', fname=None)Plot two images one on top of the other using red and green channels.
Creates a figure containing three images: the first image to the left plotted on the red channel of a color image, the second to the right plotted on the green channel of a color image and the two given images on top of each other using the red channel for the first image and the green channel for the second one. It is assumed that both images have the same shape. The intended use of this function is to visually assess the quality of a registration result.
Parameters: |
|
---|
dipy.viz.regtools.
overlay_slices
(L, R, slice_index=None, slice_type=1, ltitle='Left', rtitle='Right', fname=None)Plot three overlaid slices from the given volumes.
Creates a figure containing three images: the gray scale k-th slice of the first volume (L) to the left, where k=slice_index, the k-th slice of the second volume (R) to the right and the k-th slices of the two given images on top of each other using the red channel for the first volume and the green channel for the second one. It is assumed that both volumes have the same shape. The intended use of this function is to visually assess the quality of a registration result.
Parameters: |
|
---|
dipy.viz.regtools.
plot_2d_diffeomorphic_map
(mapping, delta=10, fname=None, direct_grid_shape=None, direct_grid2world=-1, inverse_grid_shape=None, inverse_grid2world=-1, show_figure=True)Draw the effect of warping a regular lattice by a diffeomorphic map.
Draws a diffeomorphic map by showing the effect of the deformation on a regular grid. The resulting figure contains two images: the direct transformation is plotted to the left, and the inverse transformation is plotted to the right.
Parameters: |
|
---|---|
Returns: |
|
dipy.viz.regtools.
plot_slices
(V, slice_indices=None, fname=None)Plot 3 slices from the given volume: 1 sagital, 1 coronal and 1 axial
Creates a figure showing the axial, coronal and sagital slices at the requested positions of the given volume. The requested slices are specified by slice_indices.
Parameters: |
|
---|
dipy.viz.regtools.
simple_plot
(file_name, title, x, y, xlabel, ylabel)Saves the simple plot with given x and y values
Parameters: |
|
---|