geometron package

Submodules

geometron.core module

class geometron.core.FakeClass(name=None)

Bases: object

Fake class

name
Type:

str

display(text=None)

Displays a text or name attribute if text is None

Parameters:

text (str) – if None, displays name (default=None)

geometron.core.fake_function(text='Hello World!')

Prints and returns a text after capitalizing

Parameters:

name (str) –

Returns:

text

Return type:

a text

geometron.geometries module

geometron.geometries.angles.azimuth(origin, target)

Computes the Azimuth of a target point as seen from a origin point in a planar coordinate system

Parameters:
  • origin (shapely.geometry.Point) – Point from which the target is observed

  • target (shapely.geometry.Point) – Point which is observed from the origin

Returns:

azimuth – azimuth angle in radians

Return type:

float

geometron.geometries.angles.dd_mmsss_to_dd(x)

Converts angle expressed as degrees.minutesseconds (DDD.MMSSS) to decimal degrees (DDD.XXX)

Parameters:

x (float) – angle in degrees minute

Returns:

angle – angle converted to the decimal degrees format

Return type:

float

geometron.geometries.angles.dd_to_ddmmss(x, string_output=True, precision=3)

Converts angle expressed as decimal degrees (DD) to minutes (DDMMSS)

Parameters:
  • x (float) – angle in decimal degrees

  • str (bool) – True if output is a string

  • precision (int, default : 3) – number of decimals retained for seconds in string output

Returns:

angle – angle converted to the degrees minutes seconds format

Return type:

string_output

geometron.geometries.angles.ddmm_to_dd(x)

Converts angle expressed as degrees minutes (DDDMM) to decimal degrees (DDD.XXX)

Parameters:

x (float) – angle in degrees minute

Returns:

angle – angle converted to the decimal degrees format

Return type:

float

geometron.geometries.cubic_length.cclength(coefs, x_end=1.0)

Computes the length along a cubic curve defined by the coefficients of its equation z=f(x) from 0 to x_end

Parameters:
  • coefs (list) – coefficients of the cubic curve

  • x_end (float) – length is computed for a portion of the curve whose ends are at x=0 and x=x_end

Returns:

length – length the portion of the curve

Return type:

float

geometron.geometries.cubic_length.cclength2abs(coefs, length)

Computes the x value of the point at a distance computed along a cubic curve defined by its coefficients

Parameters:
  • coefs (list) – coefficients of the cubic curve

  • length (numpy.array) – length of the portion of the curve

Returns:

x – value of the end point of the portion of the curve starting at x=0 and of given length

Return type:

float

geometron.geometries.cubic_length.cclength2xz(known_points, distances)

Computes [x,z] of points distributed at set distances along a curve defined by a set of known points and interpolated as a pchip

Parameters:
  • known_points (list, numpy.array) – points

  • distances (numpy.array) – distances from the origin of the curve to the points whose x_value are sought

Returns:

xz – list of points 2d coordinates in the xz reference system

Return type:

numpy.array

geometron.geometries.cubic_length.cclengths(known_points)

computes the distance from the first point and each given point along a curve defined by this set of known points and interpolated as a pchip

Parameters:

known_points (list, numpy.array) – 2d coordinates of known points used to compute a piecewise cubic curve

Returns:

distances along the curve at each known point

Return type:

numpy.array

geometron.geometries.transforms.affine_transform_matrix(origin_coords, destination_coords, rcond=-1, shapely_format=True)

Computes a transform matrix to use on shapely or vtk objects from control points coordinates

origin_coordslist, numpy.ndarray

2D or 3D coordinates of the control points in the origin space

destination_coordslist, numpy.ndarray

2D or 3D coordinates of the control points in the destination space

rcondfloat, default: -1

Cut-off ratio for small singular values used by numpy.linalg.lstsq

shapely_formatbool, default: True

If True, returns a transform matrix in the shapely format otherwise returns a 3x3 or 4x4 transform matrix

Returns:

  • matrix (numpy.array, list) – The transform matrix (in list form if shapely_format is True)

  • residuals (numpy.ndarray) –

    The residuals of the least-squares fitting of the parameters of the transform from the control points coordinate

    pairs

  • rank (int) – Rank of matrix a

  • singular ((min(M, N),) ndarray) – Singular values of a

Example

>>> # This example shows how to use this function to compute the affine transform matrix from 2D control points.
>>> import numpy as np
>>> import geometron.geometries.transforms as ggt
>>> origin_coords = [np.array([0.,0.]), np.array([0.,1.]), np.array([1.,0.]), np.array([1.,1.2])]
>>> destination_coords = [np.array([2.5,1.5]), np.array([2.,2.]), np.array([3.,2.]), np.array([2.5,3.])]
>>> transform_matrix, residuals, rank, singular = ggt.affine_transform_matrix(origin_coords, destination_coords)
>>> transform_matrix
[0.5450819672131152, -0.4508196721311477, 0.6803278688524602,
0.6967213114754098, 2.4754098360655745, 1.401639344262296]
geometron.geometries.transforms.flatten_geometry(geom)

Takes a 3D geometry and returns a 2D geometry discarding the third coordinate :param geom: a 3D geometry to flatten :type geom: shapely.geometry

Returns:

a 2D geometry

Return type:

shapely.geometry

geometron.geometries.transforms.project_coords_on_plane(coords, **kwargs)
geometron.geometries.transforms.projection_on_plane(plane)

Define a 3d transform corresponding to the projection on a plane

Example

>>> # This example shows how to use this function.
>>> plane = {'origin': (20,0,0), 'normal': (1, 3, 3), 'first_unit_vector' : (0,1,0)}
>>> project_coords_on_plane((1,0,0), plane = plane)
geometron.geometries.transforms.projective_transform(geometry, transform_matrix)
Parameters:
  • geometry (shapely.geometry) – geometry to transform

  • transform_matrix (numpy.ndarray) – the transform matrix

Return type:

transform geometries

geometron.geometries.transforms.projective_transform_matrix(origin_coords, destination_coords, rcond=-1)

Computes a projective transform matrix from control points coordinates

origin_coordslist, numpy.ndarray

2D coordinates of the control points in the origin space

destination_coordslist, numpy.ndarray

2D coordinates of the control points in the destination space

rcondfloat, default: -1

Cut-off ratio for small singular values used by numpy.linalg.lstsq

Returns:

matrix – The transform matrix

Return type:

numpy.ndarray, list

Example

>>> # This example shows how to use this function to compute the projective transform matrix from 2D control points.
>>> import numpy as np
>>> import geometron.geometries.transforms as ggt
>>> origin_coords = [np.array([0.,0.]), np.array([0.,1.]), np.array([1.,0.]), np.array([1.,1.2])]
>>> destination_coords = [np.array([2.5,1.5]), np.array([2.,2.]), np.array([3.,2.]), np.array([2.5,3.])]
>>> transform_matrix, residuals, rank, singular = ggt.projective_transform_matrix(origin_coords, destination_coords)
>>> transform_matrix
[0.5450819672131152, -0.4508196721311477, 0.6803278688524602,
0.6967213114754098, 2.4754098360655745, 1.401639344262296]
geometron.geometries.transforms.raise_geometry(obj, elevation=0.0)

Turns a 2d geometry or 2d geometries of a geodataframe in 3d geometry(ies) with the given constant elevation, if obj is a geodataframe, the transform is done in place.

Parameters:
  • obj (shapely.geometry or geopandas.GeoDataFrame) – the geometry

  • elevation (float) – elevation to which obj will be raised

Returns:

modified geometry(ies)

Return type:

shapely.geometry or geopandas.GeoDataFrame

Examples

>>> # This example shows how to raise a 2D Point to a 3D point with elevation set to 100.
>>> from shapely.geometry import Point
>>> from geometron.geometries.transforms import raise_geometry
>>> p = Point([1., 3.])
>>> p = raise_geometry(p, 100.)
>>> print(p)
POINT Z (1 3 100)
geometron.geometries.transforms.rotate_around_vector(vector, angle, degrees=False, affine_4x4=False)

Returns the matrix associated to a rotation by a given angle around a given vector using Rodrigues formula

Parameters:
  • vector (numpy.array) – vector around which the rotation matrix will be computed

  • angle (float) – amplitude of rotation given following the right-hand-side rule

  • degrees (bool, default: False) – set to True if angle is given in degrees rather than in radians

  • affine_4x4 (bool, default: False) – set to True to return a 4x4 affine transform matrix

Returns:

transform matrix

Return type:

numpy.array

Example

>>> # This example shows how to use this function to rotate by 90° a given vector a around vector v.
>>> import numpy as np
>>> import geometron.geometries.transforms as ggt
>>> a = np.array([0., 0., 1.])
>>> v = np.array([3., 0., 0.])
>>> angle = np.pi/2
>>> r = ggt.rotate_around_vector(v, angle)
>>> np.dot(r, a)
array([ 0.00000000e+00, -1.00000000e+00,  1.11022302e-16])
For more info. see https://en.wikipedia.org/wiki/Rodrigues'_rotation_formula#Matrix_notation
geometron.geometries.transforms.vtk_matrix_to_shapely_matrix(transform_matrix)

Translates a vtk 3x3 or 4x3 transform matrix into a shapely transform array :param transform_matrix: a 3x3 or 4x4 affine transform matrix :type transform_matrix: numpy.array

Return type:

np.ndarray

geometron.geometries.vectors.almost_colinear(v1, v2, atol=1e-08)

Tests if vectors v1 and v2 are almost colinear.

Parameters:
  • v1 (numpy.array or list) – first 2D or 3D vector

  • v2 (numpy.array or list) – second 2D or 3D vector

  • atol (float, default 1e-08) – absolute tolerance used to compare the norm of the cross product between v1 and v2 with zero

Returns:

True if v1 and v2 are almost colinear

Return type:

bool

Examples

>>> # This example shows that ux is colinear with the cross product of uy by uz
>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> ggv.almost_colinear(ggv.ux, np.cross(ggv.uy, ggv.uz))
True
geometron.geometries.vectors.almost_null(v, atol=1e-08)

Tests if v is almost the null vector (a vector with all coordinates = 0.).

Parameters:
  • v (numpy.array or list) – input vector

  • atol (float, defaut 1e-08) – absolute tolerance used to compare v with null

Returns:

True if v is almost close to null

Return type:

bool

Examples

>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> ggv.almost_null(np.array([0., 0., 0.]))
True
geometron.geometries.vectors.angle_between_vectors(v1, v2, degrees=False)

Returns the angle between 2 vectors v1 and v2

if a vector is 2D it is converted to a 3D array with third coordinate set to zero.

Parameters:
  • v1 (numpy.array or list) – first 2D or 3D vector

  • v2 (numpy.array or list) – second 2D or 3D vector

  • degrees (bool, default False) – set to True to return the angle in degrees otherwise the angle is in radians

Returns:

angle between v1 and v2

Return type:

float

Examples

>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> v1 = ggv.ux
>>> v2 = ggv.uz
>>> ggv.angle_between_vectors(v1, v2, degrees=True)
geometron.geometries.vectors.dip_and_strike_vectors(dip, strike, degrees=False)

Computes the unit vectors along the dip and the strike directions

Parameters:
  • dip (float) – dip angle counted using the right-hand side rule

  • strike (float) – strike angle counted clockwise from the North

  • degrees (bool, default False) – if True, the angles are given in degrees otherwise in radians

Returns:

unit vectors along the dip and the strike directions

Return type:

numpy.array

Examples

>>> # This example shows how to retrieve the unit vectors along the dip and the strike directions N120°E 60°S
>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> ggv.dip_and_strike_vectors(60., 120., degrees=True)
(array([-0.25     , -0.4330127, -0.8660254]),
array([ 0.8660254, -0.5      ,  0.       ]))
geometron.geometries.vectors.distance_to_segment(pt, segment)

Returns the distance between a point and a segment

Parameters:
  • pt (tuple, list or numpy.ndarray) – coordinates of the point

  • segement (tuple, list or numpy.ndarray) – coordinates of the extremities of the segment

Returns:

distance between point and segment

Return type:

float

geometron.geometries.vectors.plane_normal(args)

Returns the normal vector of a plane defined by two non co-linear vectors or three non co-linear 3D points

Parameters:

args (tuple or list or numpy.ndarray) – an array-like object of the coordinates of two 3D vectors or three points 3D points

Returns:

the unit vector normal to the plane

Return type:

numpy.array

Examples

>>> # This example shows how to search for the normal vector of the Oxy plane from two non co-linear vectors
>>> # (assuming first, second and third components of the vectors correspond to components along x, y and z
>>> # respectively in a cartesian system) :
>>> from shapely.geometry import Point
>>> import geometron.geometries.vectors as ggv
>>> v1 = Point((1., 0., 0.))
>>> v2 = Point((0., 1., 0.))
>>> ggv.plane_normal([v1, v2])
array([0., 0., 1.])
The answer is obviously a unit vector along the z-axis.
>>> # This example shows how to search for the normal vector of the Oxy plane (assuming first, second and third
>>> # components of the vectors correspond to components along x, y and z respectively in a cartesian system) :
>>> import numpy as np
>>> import geometron.geometries.vectors as ggv
>>> p1 = np.array((0., 0., 0.))
>>> p2 = np.array((1., 0., 0.))
>>> p3 = np.array((0., 1., 0.))
>>> ggv.plane_normal([p1, p2, p3])
array([0., 0., 1.])
The answer is obviously a unit vector along the z-axis.
>>> # This example shows how to search for the normal vector of the Oxy plane from three shapely Points (assuming
>>> # first, second and third components of the vectors correspond to components along x, y and z respectively in a
>>> # cartesian system) :
>>> from shapely.geometry import Point
>>> import geometron.geometries.vectors as ggv
>>> p1 = Point((0., 0., 0.))
>>> p2 = Point((1., 0., 0.))
>>> p3 = Point((0., 1., 0.))
>>> ggv.plane_normal([a, b, c])
array([0., 0., 1.])
The answer is obviously a unit vector along the z-axis.
geometron.geometries.vectors.plane_normal_from_dip_and_strike(dip, strike, degrees=False)

Computes the unit vector normal to the plane defined by the dip and the strike directions

Parameters:
  • dip (float) – dip angle counted using the right-hand side rule

  • strike (float) – strike angle counted clockwise from the North

  • degrees (bool, default False) – if True, the angles are given in degrees otherwise in radians

Returns:

unit vector normal to the plane defined by dip and strike

Return type:

numpy.array

Examples

>>> # This example shows how to retrieve the unit vector along the normal of the plane defined by dip and the strike
>>> # directions N120°E 60°S
>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> ggv.plane_normal_from_dip_and_strike(60., 120., degrees=True)
array([-0.4330127, -0.75     ,  0.5      ])
geometron.geometries.vectors.rotate_around_vector(*args, **kwargs)
geometron.geometries.vectors.unit_vector(vector)

Computes a unit vector in the direction of the given vector

Parameters:

vector (numpy.array) – the input vector

Returns:

the unit vector in the direction of the input vector

Return type:

numpy.array

Examples

>>> # This examples shows how to retrieve the unit vector in the direction of vector [1,2,3]
>>> import numpy as np
>>> from geometron.geometries import vectors as ggv
>>> v = np.array([1,2,3])
>>> ggv.unit_vector(v)
array([0.26726124, 0.53452248, 0.80178373])

geometron.interpolation module

geometron.interpolation.interpolation_2d.interpolate_xyv(gdf, col, ax=None, method='linear', extent=None, vlim=None, dx=None, dy=None, xy=None, plot=True, buffer=None, **kwargs)

Interpolate values stored in a column of a geodataframe of Points on a structured or unstructured grid

Parameters:
  • gdf (geopandas.GeoDataFrame) – A geodataframe containing points and at least a column of values to interpolate

  • col (str) – Name of the column containing the values to interpolate

  • ax (matplotlib.pyplot.axes, default: None) – A matplotlib axes to plot the interpolated map. If None, a new figure and a new axes are created

  • method (str, default: 'linear') – An interpolation method to use for interpolation on a structured grid (nearest, linear or cubic)

  • extent (iterable, default: None) – Extent of the interpolation. If None, extent is determined from the extent of gdf

  • vlim (iterable, default: None) – Minimum and maximum values for the representation of the interpolated values. If None, vlim is determined from the range of the interpolated values

  • dx (float, default: None) – Step of the grid long the x-axis. If None, dx is computed from the extent

  • dy (float, default: None) – Step of the grid long the y-axis. If None, dx is computed from the extent

  • xy (numpy.ndarray, default: None) – Coordinates of the points defining an unstructured grid for a Clough-Tocher interpolation. The method argument is ignored if xy is not None

  • plot (bool, default: True) – Plots the interpolated map in ax

  • buffer (float, default: None) – size, in map units, of the buffer around data points in gdf where the interpolated values are rendered

  • kwargs (dict) – Keywords and arguments to pass to matplotlib.pyplot.imshow or matplotlib.pyplot.triplot

Returns:

  • numpy.ndarray – Interpolated values

  • matplotlib.pyplot.AxesImages – plotted image

geometron.plot module

geometron.plot.basemaps.auto_zoom_level(extent, max_zoom=17)

Automatic determination of the zoom level to retrieve tiles from a xyz tile server

Parameters:
  • extent (tuple) – (longitude of left border, longitude of right border, latitude of bottom border, latitude of top border)

  • max_zoom (int, default: 17) – maximum zoom level

Returns:

zoom level to retrieve tiles

Return type:

int

geometron.plot.basemaps.deg2num(lon, lat, zoom, tile_size=256)

Converts WGS84 coordinates (EPSG:4326) to web pseudo-mercator coordinates (EPSG:3758)

Parameters:
  • lon (float) – longitude in decimal degrees

  • lat (float) – latitude in decimal degrees

  • zoom (int) – zoom level

  • tile_size (int) – size of the side of a square tile in pixels

Returns:

(x, y) planar coordinates in web pseudo-mercator coordinate system

Return type:

tuple

geometron.plot.basemaps.get_image_cluster(left, top, right, bottom, zoom, xyz_server_url, tile_size=256, cache_dir='./.tiles_cache', verbose=False)

Gets a cluster of tiles from a xyz server, assembles it and crops it to the given extent

Parameters:
  • left (float) – longitude in degrees of the top left corner

  • top (float) – latitude in degrees of the top left corner

  • right (float) – longitude in degrees of the bottom right corner

  • bottom (float) – latitude in degrees of the bottom right corner

  • zoom (int) – zoom level

  • xyz_server_url (str) – url of the xyz server

  • tile_size (int) – size of the side of a square tile in pixels

  • cache_dir (str, default: './.tiles_cache') – path to a directory to cache the tiles

  • verbose (bool) – verbose output if True

Returns:

(image, extent)

Return type:

tuple

geometron.plot.basemaps.plot_basemap(extent, ax=None, **kwargs)

Plots a basemap and returns a matplotlib axes

Parameters:
  • extent (tuple) – (longitude of left border, longitude of right border, latitude of bottom border, latitude of top border)

  • ax (matplotlib.pyplot.axes, default: None) – an axes into which the basemap is plotted

  • **kwargs (dict, optional) –

    dms: bool

    True if latitude and longitudes should be displayed in DD°MM’SS.SSS’’ format

    figsize: tuple, default: (16,8)

    size of the figure

    grid: str, default: ‘on’

    ’on’ to show the grid, ‘off’ to hide the grid

    zoom: int

    zoom level

    max_zoom: int, default: 17

    maximum zoom level

    xyz_server: str, default: ‘opentopomap’

    name or url of the xyz server

    tile_size: int, default=256

    size of the side of a square tile in pixels

    cache_dir: str, default: ‘./.tiles_cache’

    path to a directory to cache the tiles

    verbose: bool

    verbose output if True

geometron.plot.geological_maps.dip_and_strike_patch(xy, dip=0.0, strike=0.0, polarity=1, size=1.0, degrees=True, **kwargs) -> (<class 'matplotlib.patches.Patch'>, <class 'matplotlib.patches.Patch'>)

Creates a symbol to represent structural information for bedding observation

Parameters:
  • xy (tuple) – 2d coordinates of the observation

  • dip (float, default 0.) – angle

  • strike (float) – is the angle

  • polarity ({1,0}) – 1 for normal polarity, 0 for reversed polarity

  • size (float) – size of the symbol in the map units

  • degrees (bool, default True) – True if dip and strike angles are given in degrees, False if they are given in radians

  • kwargs (dict) – arguments passed to build the patches

Return type:

(matplotlib.patches.Patch, matplotlib.patches.Patch)

geometron.plot.geological_maps.plot_map(polygon_dict, color_dict, extent, ax=None, **kwargs)
geometron.plot.geological_maps.plot_observations(gdf_surface_points, gdf_orientations, color_dict=None, field='formation', title='', label='Z', label_unit='m', ax=None, extent=None, add_legend=True)
geometron.plot.geometries.effects(highlight)
Parameters:

highlight (bool, default: True) – Adds a white glow around symbol and label if True

Returns:

path_effects, stroke_effects

Return type:

set

geometron.plot.geometries.plot_gdf_survey(gdf, ax=None, extent=None, grid='off', highlight=True)

Plots elements of a geodataframe describing a survey using a symbology stored in symbols depending on the kind

Parameters:
  • gdf (pandas.GeoDataFrame) – A geodataframe to plot

  • ax (matplotlib.axes) – Axes in which the shapely object should be plotted

  • extent (list) – [xmin, xmax, ymin, ymax]

  • grid (str, default: 'off') – ‘on’ to show the grid, ‘off’ to hide the grid

  • highlight (bool, default: True) – Adds a white glow around symbols, lines and labels if True

Returns:

the matplotlib axes object used to plot

Return type:

matplotlib.axes

geometron.plot.geometries.plot_line(obj, ax=None, name='', kind='', highlight=True)

Plots a shapely LineString as a line using a symbology stored in symbols depending on the kind

Parameters:
  • obj (shapely.geometry) – A shapely object to plot

  • ax (matplotlib.axes) – Axes in which the shapely object should be plotted

  • name (str) – Name of the line

  • kind (str) – Kind of line (i.e. profile, baseline…)

  • highlight (bool, default: True) – Adds a white glow around line and label if True

Returns:

the matplotlib axes object used to plot

Return type:

matplotlib.axes

geometron.plot.geometries.plot_point(obj, ax=None, name='', kind='', highlight=True)

Plots a shapely Point as a marker using a symbology stored in symbols depending on the kind

Parameters:
  • obj (shapely.geometry) – A shapely object to plot

  • ax (matplotlib.axes) – Axes in which the shapely object should be plotted

  • name (str) – Name of the line

  • kind (str) – Kind of point (i.e. landmark, station…)

  • highlight (bool, default: True) – Adds a white glow around symbol and label if True

Returns:

the matplotlib axes object used to plot

Return type:

matplotlib.axes

geometron.plot.geometries.plot_profile(obj, ax=None, name='', **kwargs)

Plots a shapely LineString as a profile

Parameters:
  • obj (shapely.geometry) – A shapely object to plot

  • ax (matplotlib.axes) – Axes in which the shapely object should be plotted

  • name (str) – Name of the profile

Return type:

the matplotlib axes object used to plot

geometron.plot.geometries.plot_shapely_obj(obj=None, ax=None, **kwargs)

Plots a shapely object in matplotlib axes

Parameters:
  • obj (shapely.geometry) – A shapely object to plot

  • ax (matplotlib.axes) – Axes in which the shapely object should be plotted

  • kwargs (dict) – Keywords and arguments to pass to matplotlib plot for Point, MultiPoint, LineString, MultiLineString or LinearStrings and to patches for polygons

Returns:

the matplotlib axes object used to plot the shapely object

Return type:

matplotlib.axes

geometron.vtk module

Transforms a geopandas geodataframe into a pyvista unstructured grid Index and fields are added to the grid as cell scalar arrays if they are numeric

param gdf:

A geodataframe with unique index values

type gdf:

geopandas.GeoDataFrame

param elevation:

Column name for the elevation field, if geometry is 3D, this value will be ignored

type elevation:

str

returns:

A pyvista unstructured grid containing Points, LineStrings and Polygons with elevation as point data and other numeric values stored in columns as cell data arrays

rtype:

pv.core.pointset.UnstructuredGrid

geometron.vtk.gdf_to_ug.__dir__()

Default dir() implementation.

geometron.vtk.gdf_to_ug.__format__(format_spec, /)

Default object formatter.

geometron.vtk.gdf_to_ug.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

geometron.vtk.gdf_to_ug.__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

geometron.vtk.gdf_to_ug.__reduce__()

Helper for pickle.

geometron.vtk.gdf_to_ug.__reduce_ex__(protocol, /)

Helper for pickle.

geometron.vtk.gdf_to_ug.__sizeof__()

Size of object in memory, in bytes.

geometron.vtk.gdf_to_ug.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

geometron.vtk.transforms.map_image_to_plane(image_file, vtk_transform_matrix, flip_lr=False, flip_ud=False)
geometron.vtk.transforms.transform_vtk(transform_matrix, infile, outfile=None)

Transforms a vtk file using an affine transform in 3D defined by the transform matrix :param transform_matrix: a 4x4 affine transform matrix :type transform_matrix: numpy.ndarray :param infile: filename of a vtk file to transform :type infile: str or path :param outfile: filename of the transformed vtk file :type outfile: str or path