pynif3d.common

exception pynif3d.common.AttributeNotExistingException(variable_name, attribute_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.DevicesNotMatchingException(variable1_name, variable2_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.ExceptionBase

Bases: Exception

class pynif3d.common.Iterable

Bases: object

exception pynif3d.common.NoneVariableException(variable_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotBooleanException(variable_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotCallableException(fn_name, property_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotEqualException(variable1_name, variable2_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotInOptionsException(variable_name, options)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotIterableException(variable_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.NotPositiveIntegerException(variable_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.PathNotFoundException(path)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.ShapesNotMatchingException(variable1_name, variable2_name)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.WrongAxisException(variable_name, axis)

Bases: pynif3d.common.verification.ExceptionBase

exception pynif3d.common.WrongShapeException(variable_name, shape)

Bases: pynif3d.common.verification.ExceptionBase

pynif3d.common.check_axis(variable, axis, variable_name)
pynif3d.common.check_bool(variable, variable_name)
pynif3d.common.check_callable(fn, property_name, fn_name)
pynif3d.common.check_devices_match(variable1, variable2, variable1_name, variable2_name)
pynif3d.common.check_equal(variable1, variable2, variable1_name, variable2_name)
pynif3d.common.check_in_options(variable, options, variable_name)
pynif3d.common.check_iterable(variable, variable_name)
pynif3d.common.check_lengths_match(variable1, variable2, variable1_name, variable2_name)
pynif3d.common.check_not_none(variable, variable_name)
pynif3d.common.check_path_exists(path)
pynif3d.common.check_pos_int(variable, variable_name)
pynif3d.common.check_shape(variable, shape, variable_name)
pynif3d.common.check_shapes_match(variable1, variable2, variable1_name, variable2_name)
pynif3d.common.check_true(variable, variable_name)
pynif3d.common.coordinate2index(coordinates, resolution)

The function to convert 2D / 3D coordinates into 1D indices. It supports only the square / cubical resolution.

Parameters
  • coordinates (Tensor) – 2D or 3D coordinates. axis=2 shall contain the coordinate information.

  • resolution (int) – The spatial resolution of the coordinates to be parsed.

Returns

Tensor containing 1D locations indices of the input coordinates.

pynif3d.common.decompose_projection(projection)
pynif3d.common.init_Conv2d(size_in, size_out, kernel_size, **kwargs)
pynif3d.common.init_ConvTranspose2d(size_in, size_out, kernel_size, **kwargs)
pynif3d.common.init_Linear(size_in, size_out, **kwargs)
pynif3d.common.is_image_file(file_path)
pynif3d.common.normalize_coordinate(point, padding=0.1, plane='xz', eps=1e-05)

The function to normalize coordinates to [0, 1], considering input within the limits of [-0.5 * (1 + padding), +0.5 * (1 + padding)]. The input limits are not strongly enforced.

Parameters
  • point (Tensor) – The tensor of the points to be normalized within given interval. It has to have shape (batch_size, n_points, 3)

  • padding (float) – The ratio of padding to be applied within [lim_min, lim_max]. Default is 0.1.

  • plane (str) – The plane to apply the normalization. Options are (“xy”, “xz”, “yz”, “grid”). Default is “xz”.

  • eps – The epsilon to prevent zero-division. Default is 1e-5.

Returns

Tensor of the points scaled and shifted to [lim_min, lim_max]