skimage 0.17.2

ParametersReturnsBackRef
montage(arr_in, fill='mean', rescale_intensity=False, grid_shape=None, padding_width=0, multichannel=False)

Create a rectangular montage from an input array representing an ensemble of equally shaped single- (gray) or multichannel (color) images.

For example, montage(arr_in) called with the following :None:None:`arr_in`

+---+---+---+ | 1 | 2 | 3 | +---+---+---+

will return

+---+---+ | 1 | 2 | +---+---+ | 3 | * | +---+---+

where the '*' patch will be determined by the :None:None:`fill` parameter.

Parameters

arr_in : (K, M, N[, C]) ndarray

An array representing an ensemble of :None:None:`K` images of equal shape.

fill : float or array-like of floats or 'mean', optional

Value to fill the padding areas and/or the extra tiles in the output array. Has to be :None:None:`float` for single channel collections. For multichannel collections has to be an array-like of shape of number of channels. If mean , uses the mean value over all images.

rescale_intensity : bool, optional

Whether to rescale the intensity of each image to [0, 1].

grid_shape : tuple, optional

The desired grid shape for the montage :None:None:`(ntiles_row, ntiles_column)`. The default aspect ratio is square.

padding_width : int, optional

The size of the spacing between the tiles and between the tiles and the borders. If non-zero, makes the boundaries of individual images easier to perceive.

multichannel : boolean, optional

If True, the last :None:None:`arr_in` dimension is threated as a color channel, otherwise as spatial.

Returns

arr_out : (K*(M+p)+p, K*(N+p)+p[, C]) ndarray

Output array with input images glued together (including padding p).

Create a montage of several single- or multichannel images.

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy as np
... from skimage.util import montage
... arr_in = np.arange(3 * 2 * 2).reshape(3, 2, 2)
... arr_in # doctest: +NORMALIZE_WHITESPACE array([[[ 0, 1], [ 2, 3]], [[ 4, 5], [ 6, 7]], [[ 8, 9], [10, 11]]])
This example is valid syntax, but we were not able to check execution
>>> arr_out = montage(arr_in)
... arr_out.shape (4, 4)
This example is valid syntax, but we were not able to check execution
>>> arr_out
array([[ 0,  1,  4,  5],
       [ 2,  3,  6,  7],
       [ 8,  9,  5,  5],
       [10, 11,  5,  5]])
This example is valid syntax, but we were not able to check execution
>>> arr_in.mean()
5.5
This example is valid syntax, but we were not able to check execution
>>> arr_out_nonsquare = montage(arr_in, grid_shape=(1, 3))
... arr_out_nonsquare array([[ 0, 1, 4, 5, 8, 9], [ 2, 3, 6, 7, 10, 11]])
This example is valid syntax, but we were not able to check execution
>>> arr_out_nonsquare.shape
(2, 6)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.util._montage.montage

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/util/_montage.py#7
type: <class 'function'>
Commit: