Dimensional reduction (darsia.signals.reduction)#

Tools to reduce the dimensionality of an Image in space and range.

Submodules#

darsia.signals.reduction.dimensionreduction module#

Dimension modification (reduction along axis and extrusion).

class AxisReduction(axis, dim=3, mode='average', **kwargs)[source]#

Bases: object

Object for reduction along a provided axis.

axis#

Cartesian axis along which reduction is performed.

index#

Matrix index along which reduction is performed.

kwargs#

Additional arguments.

mode#

Mode.

extrude_along_axis(img, height, num)[source]#

Extrude 2d image to a 3d image.

NOTE: For now the extrusion is performed along the z axis.

Parameters:
  • img (darsia.Image) – 2d image

  • height (float) – height of the extrusion

  • num (int) – number of pixels per extruded axis

Returns:

3d image

Return type:

darsia.Image

reduce_axis(image, axis, mode='average', **kwargs)[source]#

Utility function, essentially wrapping AxisReduction as a method.

Parameters:
  • img (Image) – nd image.

  • axis (int or str) – numeric index (corresponding to matrix indexing) or Cartesian axis

  • mode (str) – mode used in the reduction (“sum”, “scaled”, “slice”)

  • kwargs – additional arguments: - “slice_idx” (int): index of the slice (only for mode “slice”)

Returns:

(n-1)d image.

Return type:

Image

darsia.signals.reduction.monochromatic module#

Module providing dimension reductions to monochromatic/scalar signals.

class MonochromaticReduction(**kwargs)[source]#

Bases: SignalReduction

darsia.signals.reduction.signalreduction module#

Module defining a plain signal reduction

class SignalReduction[source]#

Bases: object