Skip to main content

Interactive path tracing in 2D medical images

Project description

pt2d (Path Tracing in 2D images)

This repository is no longer being updated.

Description

An interactive GUI for path tracing and extraction in 2D images. The inteded use is for 2D medical images of Amphisbaena sutures, but we have found that it extends well into other domains aswell for path extraction in 2D images.

The user places a start and end point between which the program automatically finds a viable path. The user can place multiple new guide points to help fit the path to their liking. The smoothness of the path can be adjusted aswell. Advanced settings are available.

The points making up the final path can be exported to a .csv file.

General usage of the GUI

Installation

The program can be installed using pip:

pip install pt2d

Usage

To open the program type out pt2d in a terminal. The GUI looks the following:

General GUI layout

The functionality of the program extends to the following:

  • Main window:
    • Start/end point of the path
    • Add new points (left click)
    • Drag points (hold left click on point and drag)S
    • Drag image (hold left click and drag)
    • Remove points (right click on point)
    • Zoom (mouse wheel)
    • Export as .csv file
  • Advanced window:
    • Rainbow toggle (displays a color gradient showing the order of points)
    • Calibration of filter
      • Resize dot (mouse wheel on dot)
    • Line smoothing
    • Contrast
    • Displays contrasted blurred image
    • Displays cost image

Methodology

The project follows a simple methodology somewhat similar to that of the livewire segmentation technique.

  • Grayscaling: The image is converted to grayscale for simpler processing.
  • Contrasting: The contrast in the image is enhanced to improve visibility of the path.
  • Smoothing: Gaussian blurring is applied to improve generalization.
  • Edge detection: The Canny edge detector is applied to generate an image highlighting the edges in the original image.
  • Convolution: A disk-shaped kernel, with values increasing radially from the center to the circumference, is convolved with the image to create a new image highlighting the centers of the paths.
  • Cost image creation: A cost image is generated by first identifying the maximum intensity value of the convolved image, I_max. The cost at each pixel is then computed as (I_max - I(x,y))**4, where I(x,y) represents the intensity at pixel (x,y).
  • Graph construction: A graph is then constructed by connecting every pixel to it's 8 neighbouring pixels. The cost of going between two given pixels will simply be the average of the two pixel's values in the cost image.
  • Pathfinding: Djikstra's algorithm is then applied to find the cheapest path from the user placed start point to the user placed end point.

Known bugs & issues

  • Guide points need to be placed in order from start to finish along the path for the extracted path not to overlap incorrectly.
  • Dots don't currently scale with the image size, meaning the dots will appear small on large images.

Authors and acknowledgment

This project is developed by Aske T. Rove, Christian L. Bjerregaard & Mikkel W. Breinstrup under the supervision of Hans M. Kjer & Felipe D. Matos at DTU Compute.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pt2d-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pt2d-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pt2d-0.1.0.tar.gz.

File metadata

  • Download URL: pt2d-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.4

File hashes

Hashes for pt2d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9f3c5a595b07e7d79cd755a238d9095f06f1ebece5fbef21ef6912c21f5dee0
MD5 d91843863b95910153073cc98a1c31ce
BLAKE2b-256 c9c78267d3449a35e2167ab59b48f597dd9b72c84f49afee4676fc9b8eb68367

See more details on using hashes here.

File details

Details for the file pt2d-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pt2d-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.4

File hashes

Hashes for pt2d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57555478459fd69c89c7ac9b24ecf01013190cb9448213479c01b3bb758f4405
MD5 fc644deadcbf46e7a5743f88b824158e
BLAKE2b-256 78301164a1eb285d18a422c793c62c3c4ca6428dc7bdb034f1c8c9d67f97b5e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page