Visualization
Class defining a wrapper for allowing scrolling through different slices of a 3-D image when using plt.show().
Source code in pygrpm/visualization/index_tracker.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
__init__(img_array, slice_axis=0, fig=None, ax=None, **kwargs)
Description: Constructs an imshow object, defining the central portion of the 3-D image, and the axis that represents the slices. It uses the minimum (minv) and maximum value (maxv) to create a colorbar, and to define the colormap (cmap). An interactive image is created at the end, where scrolling through different slices is possible in the window plt.show().
Args: fig: plt.Figure Figure object created from "fig, ax = plt.subplots()" ax: plt.Axes Axes object created from "fig, ax = plt.subplots()" img_array: Array, list, np.ndarray 3-D array containing image overlay: A 3D array of the same shape as img_array to overlay atop slice_axis: int Axis where slices are located for a 3-D image (usually 0 or 2). Defaults to 0. overlay_args: Dictionary of arguments to pass to the overlay's imshow. **kwargs: any Arguments passed to matplotlib's imshow()
Source code in pygrpm/visualization/index_tracker.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
add_overlay(overlay, **kwargs)
method to add an overlay array on the main view. Pixels desired to be transparent should be set to numpy.NaN @param overlay: numpy array of the overlay @param kwargs: paramters for the imshow of the overlay
Source code in pygrpm/visualization/index_tracker.py
113 114 115 116 117 118 119 120 121 |
|
colorbar(mappable=None, **kwargs)
Simple wrapper to define the colorbar. @param mappable: The matplotlib.cm.ScalarMappable (i.e., AxesImage, ContourSet, etc.) described by this colorbar
Source code in pygrpm/visualization/index_tracker.py
130 131 132 133 134 135 136 137 138 139 140 |
|
show()
staticmethod
Simple wrapper to open Window to show image.
Source code in pygrpm/visualization/index_tracker.py
123 124 125 126 127 128 |
|