States

class States(*args, **kwargs)[source]

States component of geological model.

affine_transform(func, attr, *args, inplace=False, **kwargs)

Compute affine_transform for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.affine_transform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.affine_transform.

Returns

output – Transformed component.

Return type

SpatialComponent

apply(func, attr, *args, inplace=False, **kwargs)[source]

Apply function to each timestamp of states attributes.

Parameters
  • func (callable) – A function to apply. Must accept data as its first argument.

  • attr (str, array-like) – Attributes to get data from.

  • args (misc) – Any additional positional arguments to func.

  • inplace (bool) – Modify сomponent inplace.

  • kwargs (misc) – Any additional named arguments to func.

Returns

output – Transformed component.

Return type

States

property attributes

Array of attributes.

binary_closing(func, attr, *args, inplace=False, **kwargs)

Compute binary_closing for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_closing.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_closing.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_dilation(func, attr, *args, inplace=False, **kwargs)

Compute binary_dilation for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_dilation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_dilation.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_erosion(func, attr, *args, inplace=False, **kwargs)

Compute binary_erosion for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_erosion.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_erosion.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_fill_holes(func, attr, *args, inplace=False, **kwargs)

Compute binary_fill_holes for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_fill_holes.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_fill_holes.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_hit_or_miss(func, attr, *args, inplace=False, **kwargs)

Compute binary_hit_or_miss for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_hit_or_miss.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_hit_or_miss.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_opening(func, attr, *args, inplace=False, **kwargs)

Compute binary_opening for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_opening.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_opening.

Returns

output – Transformed component.

Return type

SpatialComponent

binary_propagation(func, attr, *args, inplace=False, **kwargs)

Compute binary_propagation for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_propagation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_propagation.

Returns

output – Transformed component.

Return type

SpatialComponent

black_tophat(func, attr, *args, inplace=False, **kwargs)

Compute black_tophat for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.black_tophat.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.black_tophat.

Returns

output – Transformed component.

Return type

SpatialComponent

center_of_mass(func, attr, *args, inplace=False, **kwargs)

Compute center_of_mass for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.center_of_mass.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.center_of_mass.

Returns

output – Transformed component.

Return type

SpatialComponent

property class_name

Name of the component.

clip(func, attr, *args, inplace=False, **kwargs)

Compute array of cliped values for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.clip.

  • kwargs (misc) – Any additional named arguments to numpy.clip.

Returns

output – Transformed component.

Return type

SpatialComponent

convolve(func, attr, *args, inplace=False, **kwargs)

Compute convolve for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.convolve.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.convolve.

Returns

output – Transformed component.

Return type

SpatialComponent

convolve1d(func, attr, *args, inplace=False, **kwargs)

Compute convolve1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.convolve1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.convolve1d.

Returns

output – Transformed component.

Return type

SpatialComponent

copy()

Returns a deepcopy of attributes. Cached properties are not copied.

correlate(func, attr, *args, inplace=False, **kwargs)

Compute correlate for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.correlate.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.correlate.

Returns

output – Transformed component.

Return type

SpatialComponent

correlate1d(func, attr, *args, inplace=False, **kwargs)

Compute correlate1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.correlate1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.correlate1d.

Returns

output – Transformed component.

Return type

SpatialComponent

crop(func, attr, *args, inplace=False, **kwargs)

Compute cropped array by crop_width along each dimension for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to crop.

  • kwargs (misc) – Any additional named arguments to crop.

Returns

output – Transformed component.

Return type

SpatialComponent

del_state(*args)

State remover.

distance_transform_bf(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_bf for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_bf.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_bf.

Returns

output – Transformed component.

Return type

SpatialComponent

distance_transform_cdt(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_cdt for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_cdt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_cdt.

Returns

output – Transformed component.

Return type

SpatialComponent

distance_transform_edt(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_edt for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_edt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_edt.

Returns

output – Transformed component.

Return type

SpatialComponent

drop(attr)

Drop an attribute.

dump(path, **kwargs)

Dump attributes into file.

Parameters
  • path (str) – Path to output file.

  • kwargs (dict, optional) – Any kwargs for dump method.

Returns

comp – BaseComponent unchanged.

Return type

BaseComponent

static dump_array_ascii(buffer, array, header=None, fmt='%f', compressed=True)

Writes array-like data into an ASCII buffer.

Parameters
  • buffer (buffer-like) –

  • array (1d, array-like) – Array to be saved

  • header (str, optional) – String to be written line before the array

  • fmt (str or sequence of strs, optional) – Format to be passed into numpy.savetxt function. Default to ‘%f’.

  • compressed (bool) – If True, uses compressed typing style

empty_like()

Get an empty component with the same state and the structure of embedded BaseComponents (if any).

extrema(func, attr, *args, inplace=False, **kwargs)

Compute extrema for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.extrema.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.extrema.

Returns

output – Transformed component.

Return type

SpatialComponent

find_objects(func, attr, *args, inplace=False, **kwargs)

Compute find_objects for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.find_objects.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.find_objects.

Returns

output – Transformed component.

Return type

SpatialComponent

flip(func, attr, *args, inplace=False, **kwargs)

Compute reversed order of elements in an array along the given axis for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.flip.

  • kwargs (misc) – Any additional named arguments to numpy.flip.

Returns

output – Transformed component.

Return type

SpatialComponent

fourier_ellipsoid(func, attr, *args, inplace=False, **kwargs)

Compute fourier_ellipsoid for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_ellipsoid.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_ellipsoid.

Returns

output – Transformed component.

Return type

SpatialComponent

fourier_gaussian(func, attr, *args, inplace=False, **kwargs)

Compute fourier_gaussian for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_gaussian.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_gaussian.

Returns

output – Transformed component.

Return type

SpatialComponent

fourier_shift(func, attr, *args, inplace=False, **kwargs)

Compute fourier_shift for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_shift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_shift.

Returns

output – Transformed component.

Return type

SpatialComponent

fourier_uniform(func, attr, *args, inplace=False, **kwargs)

Compute fourier_uniform for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_uniform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_uniform.

Returns

output – Transformed component.

Return type

SpatialComponent

gaussian_filter(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

gaussian_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

gaussian_gradient_magnitude(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_gradient_magnitude for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_gradient_magnitude.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_gradient_magnitude.

Returns

output – Transformed component.

Return type

SpatialComponent

gaussian_laplace(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_laplace for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_laplace.

Returns

output – Transformed component.

Return type

SpatialComponent

generic_filter(func, attr, *args, inplace=False, **kwargs)

Compute generic_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

generic_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute generic_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

generic_gradient_magnitude(func, attr, *args, inplace=False, **kwargs)

Compute generic_gradient_magnitude for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_gradient_magnitude.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_gradient_magnitude.

Returns

output – Transformed component.

Return type

SpatialComponent

generic_laplace(func, attr, *args, inplace=False, **kwargs)

Compute generic_laplace for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_laplace.

Returns

output – Transformed component.

Return type

SpatialComponent

geometric_transform(func, attr, *args, inplace=False, **kwargs)

Compute geometric_transform for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.geometric_transform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.geometric_transform.

Returns

output – Transformed component.

Return type

SpatialComponent

gradient(func, attr, *args, inplace=False, **kwargs)

Compute gradient for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.gradient.

  • kwargs (misc) – Any additional named arguments to numpy.gradient.

Returns

output – Transformed component.

Return type

SpatialComponent

grey_closing(func, attr, *args, inplace=False, **kwargs)

Compute grey_closing for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_closing.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_closing.

Returns

output – Transformed component.

Return type

SpatialComponent

grey_dilation(func, attr, *args, inplace=False, **kwargs)

Compute grey_dilation for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_dilation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_dilation.

Returns

output – Transformed component.

Return type

SpatialComponent

grey_erosion(func, attr, *args, inplace=False, **kwargs)

Compute grey_erosion for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_erosion.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_erosion.

Returns

output – Transformed component.

Return type

SpatialComponent

grey_opening(func, attr, *args, inplace=False, **kwargs)

Compute grey_opening for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_opening.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_opening.

Returns

output – Transformed component.

Return type

SpatialComponent

histogram(func, attr, *args, inplace=False, **kwargs)

Compute histogram for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.histogram.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.histogram.

Returns

output – Transformed component.

Return type

SpatialComponent

init_state(**kwargs)

Init state attributes.

items()

Returns pairs of attribute’s names and data.

keys()

Array of attributes.

label(func, attr, *args, inplace=False, **kwargs)

Compute label for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.label.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.label.

Returns

output – Transformed component.

Return type

SpatialComponent

labeled_comprehension(func, attr, *args, inplace=False, **kwargs)

Compute labeled_comprehension for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.labeled_comprehension.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.labeled_comprehension.

Returns

output – Transformed component.

Return type

SpatialComponent

laplace(func, attr, *args, inplace=False, **kwargs)

Compute laplace for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.laplace.

Returns

output – Transformed component.

Return type

SpatialComponent

load(path_or_buffer, **kwargs)

Load data from a file or buffer.

Parameters
  • path_or_buffer (str of string buffer) – Source to read data from.

  • **kwargs (dict, optional) – Any kwargs to be passed to load method.

Returns

comp – BaseComponent with loaded attributes.

Return type

BaseComponent

map_coordinates(func, attr, *args, inplace=False, **kwargs)

Compute map_coordinates for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.map_coordinates.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.map_coordinates.

Returns

output – Transformed component.

Return type

SpatialComponent

maximum(func, attr, *args, inplace=False, **kwargs)

Compute maximum for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum.

Returns

output – Transformed component.

Return type

SpatialComponent

maximum_filter(func, attr, *args, inplace=False, **kwargs)

Compute maximum_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

maximum_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute maximum_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

maximum_position(func, attr, *args, inplace=False, **kwargs)

Compute maximum_position for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_position.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_position.

Returns

output – Transformed component.

Return type

SpatialComponent

mean(func, attr, *args, inplace=False, **kwargs)

Compute mean for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.mean.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.mean.

Returns

output – Transformed component.

Return type

SpatialComponent

median(func, attr, *args, inplace=False, **kwargs)

Compute median for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.median.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.median.

Returns

output – Transformed component.

Return type

SpatialComponent

median_filter(func, attr, *args, inplace=False, **kwargs)

Compute median_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.median_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.median_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

minimum(func, attr, *args, inplace=False, **kwargs)

Compute minimum for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum.

Returns

output – Transformed component.

Return type

SpatialComponent

minimum_filter(func, attr, *args, inplace=False, **kwargs)

Compute minimum_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

minimum_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute minimum_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

minimum_position(func, attr, *args, inplace=False, **kwargs)

Compute minimum_position for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_position.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_position.

Returns

output – Transformed component.

Return type

SpatialComponent

morphological_gradient(func, attr, *args, inplace=False, **kwargs)

Compute morphological_gradient for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.morphological_gradient.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.morphological_gradient.

Returns

output – Transformed component.

Return type

SpatialComponent

morphological_laplace(func, attr, *args, inplace=False, **kwargs)

Compute morphological_laplace for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.morphological_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.morphological_laplace.

Returns

output – Transformed component.

Return type

SpatialComponent

property n_timesteps

Effective number of timesteps.

pad(func, attr, *args, inplace=False, **kwargs)

Compute padded array for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.pad.

  • kwargs (misc) – Any additional named arguments to numpy.pad.

Returns

output – Transformed component.

Return type

SpatialComponent

pad_na(attr, actnum, fill_na=0.0, inplace=True)[source]

Add dummy cells into the state vector in the positions of non-active cells if necessary.

Parameters
  • attr (str, array-like) – Attributes to be padded with non-active cells.

  • actnum (array-like of type bool) – Vector representing a mask of active and non-active cells.

  • fill_na (float) – Value to be used as filler.

  • inplace (bool) – Modify сomponent inplace.

Returns

output

Return type

component if inplace else padded attribute.

percentile_filter(func, attr, *args, inplace=False, **kwargs)

Compute percentile_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.percentile_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.percentile_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

prewitt(func, attr, *args, inplace=False, **kwargs)

Compute prewitt for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.prewitt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.prewitt.

Returns

output – Transformed component.

Return type

SpatialComponent

random_noise(func, attr, *args, inplace=False, **kwargs)

Compute array with added random noise of various types for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to random_noise.

  • kwargs (misc) – Any additional named arguments to random_noise.

Returns

output – Transformed component.

Return type

SpatialComponent

rank_filter(func, attr, *args, inplace=False, **kwargs)

Compute rank_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.rank_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.rank_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

ravel(attr=None, inplace=True, **kwargs)

Brings component to ravel state. If not inplace returns ravel representation for attributes with pre-defined ravel transformation.

Parameters
  • attr (str, array of str) – Attribute to ravel.

  • inplace (bool) – Modify сomponent inplace.

  • kwargs (misc) – Additional named arguments.

Returns

out

Return type

component if inplace else raveled attribute.

rescale(func, attr, *args, inplace=False, **kwargs)

Compute rescale for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to skimage.transform.rescale.

  • kwargs (misc) – Any additional named arguments to skimage.transform.rescale.

Returns

output – Transformed component.

Return type

SpatialComponent

reshape(attr, newshape, order='C', inplace=True)

Reshape numpy.ndarray attributes.

Parameters
  • attr (str, array of str) – Attribute to be reshaped.

  • newshape (tuple) – New shape.

  • order (str) – Numpy reshape order. Default to ‘C’.

  • inplace (bool) – If True, reshape is made inplace, return BaseComponent. Else, return reshaped attribute.

Returns

output

Return type

BaseComponent if inplace else reshaped attribute itself.

resize(func, attr, *args, inplace=False, **kwargs)

Compute resize for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to skimage.transform.resize.

  • kwargs (misc) – Any additional named arguments to skimage.transform.resize.

Returns

output – Transformed component.

Return type

SpatialComponent

rot90(func, attr, *args, inplace=False, **kwargs)

Compute rotated an array by 90 degrees in the plane specified by axes for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.rot90.

  • kwargs (misc) – Any additional named arguments to numpy.rot90.

Returns

output – Transformed component.

Return type

SpatialComponent

rotate(func, attr, *args, inplace=False, **kwargs)

Compute rotate for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.rotate.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.rotate.

Returns

output – Transformed component.

Return type

SpatialComponent

sample_crops(attr, shape, size=1)

Sample random crops of fixed shape.

Parameters
  • attr (str, array-like) – Attributes to sample crops from. If None, use all attributes.

  • shape (tuple) – Shape of crops.

  • size (int, optional) – Number of crops to sample. Default to 1.

Returns

crops – Sampled crops.

Return type

ndarray

set_state(**kwargs)

State setter.

shift(func, attr, *args, inplace=False, **kwargs)

Compute shift for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.shift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.shift.

Returns

output – Transformed component.

Return type

SpatialComponent

show_cube(attr, t=None, x=None, y=None, z=None, actnum=None, figsize=None, **kwargs)[source]

Visualize slices of 4D states arrays. If no slice is specified, spatial slices will be shown with interactive slider widgets.

Parameters
  • attr (str) – Attribute to show.

  • t (int or None, optional) – Timestamp to show.

  • x (int or None, optional) – Slice along x-axis to show.

  • y (int or None, optional) – Slice along y-axis to show.

  • z (int or None, optional) – Slice along z-axis to show.

  • actnum (array, optional) – Actnum array. If None, all cell are active.

  • figsize (array-like, optional) – Output plot size.

  • kwargs (dict, optional) – Additional keyword arguments for plot.

sobel(func, attr, *args, inplace=False, **kwargs)

Compute sobel for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.sobel.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.sobel.

Returns

output – Transformed component.

Return type

SpatialComponent

spline_filter(func, attr, *args, inplace=False, **kwargs)

Compute spline_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.spline_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.spline_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

spline_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute spline_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.spline_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.spline_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

standard_deviation(func, attr, *args, inplace=False, **kwargs)

Compute standard_deviation for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.standard_deviation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.standard_deviation.

Returns

output – Transformed component.

Return type

SpatialComponent

property state

Get state.

strip_na(attr, actnum, inplace=True)[source]

Remove non-active cells from the state vector.

Parameters
  • attr (str, array-like) – Attributes to be stripped

  • actnum (array-like of type bool) – Vector representing mask of active and non-active cells.

  • inplace (bool) – Modify сomponent inplace.

Returns

output

Return type

component if inplace else stripped attribute.

Notes

Outputs 1d array for each timestamp.

sum(func, attr, *args, inplace=False, **kwargs)

Compute sum for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.sum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.sum.

Returns

output – Transformed component.

Return type

SpatialComponent

to_spatial(attr=None, inplace=True, **kwargs)

Bring component to spatial state. If not inplace returns spatial representation for attributes with pre-defined spatial transformation.

Parameters
  • attr (str, array of str) – Attribute to ravel.

  • inplace (bool) – Modify сomponent inplace.

  • kwargs (misc) – Additional named arguments.

Returns

out

Return type

сomponent if inplace else raveled attribute.

uniform_filter(func, attr, *args, inplace=False, **kwargs)

Compute uniform_filter for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.uniform_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.uniform_filter.

Returns

output – Transformed component.

Return type

SpatialComponent

uniform_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute uniform_filter1d for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.uniform_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.uniform_filter1d.

Returns

output – Transformed component.

Return type

SpatialComponent

unravel(*args, **kwargs)

Alias for to_spatial method.

Deprecated since version Renamed: to_spatial

values()

Returns a generator of attribute’s data.

variance(func, attr, *args, inplace=False, **kwargs)

Compute variance for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.variance.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.variance.

Returns

output – Transformed component.

Return type

SpatialComponent

watershed_ift(func, attr, *args, inplace=False, **kwargs)

Compute watershed_ift for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.watershed_ift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.watershed_ift.

Returns

output – Transformed component.

Return type

SpatialComponent

white_tophat(func, attr, *args, inplace=False, **kwargs)

Compute white_tophat for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.white_tophat.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.white_tophat.

Returns

output – Transformed component.

Return type

SpatialComponent

zoom(func, attr, *args, inplace=False, **kwargs)

Compute zoom for given data.

Parameters
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.zoom.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.zoom.

Returns

output – Transformed component.

Return type

SpatialComponent