curve_apps.edges package

Submodules

curve_apps.edges.driver module

class curve_apps.edges.driver.EdgesDriver(*args: Any, **kwargs: Any)

Bases: BaseCurveDriver

Driver for the edge detection application.

Parameters:

parameters – Application parameters.

static get_canny_edges(grid: geoh5py.objects.Grid2D, data: geoh5py.data.FloatData, detection: EdgeDetectionParameters) numpy.ndarray

Get edges from a grid.

Parameters:
  • grid – Grid2D object.

  • data – FloatData object.

  • detection – Detection parameters.

Returns:

Edges from Canny transform.

static get_edges(grid: geoh5py.objects.Grid2D, edges: numpy.ndarray, detection: EdgeDetectionParameters) tuple[numpy.ndarray, numpy.ndarray] | tuple[None, None]

Find edges in gridded data.

Params grid:

A Grid2D object.

Params edges:

Edges representation of the grid from Canny transform.

Params detection:

Detection parameters.

:returns : n x 3 array. Vertices of edges. :returns : n x 2 float array. Cells of edges.

static get_line_indices(canny_image: numpy.ndarray, line_length: int = 1, line_gap: int = 1, threshold: int = 1, window_size: int | None = None) list

Get indices forming lines on a canny image.

The process is done over tiles of square size. The tiles overlap by 25%.

Parameters:
  • canny_image – Edges.

  • line_length – Minimum accepted pixel length of detected lines. (Hough)

  • line_gap – Maximum gap between pixels to still form a line. (Hough)

  • threshold – Value threshold. (Hough)

  • window_size – Size of the window to search for lines.

Returns:

List of indices.

make_curve()

Make curve object from edges detected in source data.

The application relies on the Canny and Hough transforms from the Scikit-Image library.

curve_apps.edges.params module

class curve_apps.edges.params.EdgeDetectionParameters(*args: Any, **kwargs: Any)

Bases: BaseModel

Edge detection parameters.

Parameters:
  • line_length – Minimum accepted pixel length of detected lines. (Hough)

  • line_gap – Maximum gap between pixels to still form a line. (Hough)

  • sigma – Standard deviation of the Gaussian filter. (Canny)

  • threshold – Value threshold. (Hough)

  • window_size – Size of the window to search for lines.

  • merge_length – Minimum length between nodes that should be merged.

line_gap: int = 1
line_length: int = 1
merge_length: float | None = None
sigma: float = 10
threshold: int = 1
window_size: int | None = None
class curve_apps.edges.params.EdgeOutputParameters(*args: Any, **kwargs: Any)

Bases: BaseModel

Output parameters.

Parameters:
  • export_as – Name of the output entity.

  • out_group – Name of the output group.

export_as: str | None = 'edges'
out_group: UIJsonGroup | None = None
class curve_apps.edges.params.EdgeParameters(*args: Any, **kwargs: Any)

Bases: BaseData

Edge detection parameters for use with edges.driver.

Parameters:
  • detection – Detection parameters expected for the edge detection.

  • source – Parameters for the source object and data.

  • output – Output parameters.

conda_environment: str = 'curve_apps'
default_ui_json: ClassVar[Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/mirageoscience-curve-apps/envs/latest/lib/python3.10/site-packages/curve_apps-assets/uijson/edges.ui.json')
detection: EdgeDetectionParameters
name: ClassVar[str] = 'edges'
run_command: ClassVar[str] = 'curve_apps.edges.driver'
source: EdgeSourceParameters
title: ClassVar[str] = 'Edge Detection'
class curve_apps.edges.params.EdgeSourceParameters(*args: Any, **kwargs: Any)

Bases: BaseModel

Source parameters expected by the ui.json file format.

Parameters:
  • objects – A Grid2D source object.

  • data – Data values to find edges on.

data: FloatData
objects: Grid2D