mango.image.gather_slice

mango.image.gather_slice(input, axis=0, index=0, rank=None)

Gathers a 2D slice of a 3D mango.Dds array to a single process.

Parameters:
  • input (mango.Dds) – mango.Dds image from which the slice is copied.
  • axis (int) – The indexing axis from which the slice is copied. For example, axis=0 specifies an xy slice, axis=1 specifies an xz slice and axis=2 specifies a yz slice.
  • index (int) – The global index (relative to input.origin) of the slice.
  • rank (int or None) – The MPI rank of the process where the slice is copied. If rank=None the slice is gathered to all processes.
Return type:

mango.Dds

Returns:

Slice image.

For example::
>>> import mango;
>>> dds = mango.zeros(origin=(16,-32,64), shape=(32,64,128))
>>> slcDds = mango.image.gather_slice(dds, axis=0, index=dds.shape[0]//2, rank=None)
>>> print("slcDds.origin = %s" % (slcDds.origin,))
slcDds.origin = [ 32 -32  63]
>>> print("slcDds.shape  = %s" % (slcDds.shape,))
slcDds.shape  = [ 1 64 128]

Previous topic

mango.image.subsample

Next topic

mango.image.SphericalHistogram

This Page