etomo.operators.linear.utils#

This module contains usefull methods for electron tomography applications.

flatten(x)[source]#

Flatten list an array.

Parameters

x (numpy.ndarray or list(numpy.ndarray)) – the input dataset.

Returns

  • y (ndarray) – the flatten input list of array.

  • shape (list(tuple)) – the input list of array structure.

unflatten(y, shape)[source]#

Unflatten a flattened array.

Parameters
Returns

x – the unflattened dataset.

Return type

numpy.ndarray or list(numpy.ndarray)

flatten_swtn(x)[source]#

Flatten list an array.

Parameters

x (list(dict) or list(numpy.ndarray)) – the input data

Returns

  • y (numpy.ndarray) – the flatten input list of array.

  • shape (list(dict)) – the input list of array structure.

unflatten_swtn(y, shape)[source]#

Unflatten a flattened array.

Parameters
  • y (numpy.ndarray) – a flattened input array.

  • shape (list(dict)) – the output structure information.

Returns

x – the unflattened dataset.

Return type

list(numpy.ndarray)

flatten_wave(x)[source]#

Flatten list an array.

Parameters

x (list(dict) or list(numpy.ndarray)) – the input data

Returns

  • y (numpy.ndarray) – the flatten input list of array.

  • shape (list(dict)) – the input list of array structure.

unflatten_wave(y, shape)[source]#

Unflatten a flattened array.

Parameters
  • y (numpy.ndarray) – a flattened input array.

  • shape (list(dict)) – the output structure information.

Returns

x – the unflattened dataset.

Return type

list(numpy.ndarray)