Skip to main content

Endoscopic Content Area (ECA) dataset

A simple python loader for the Endoscopic Content Area (ECA) dataset. An implementation of the hausdorff distance, optimised for content areas, is also included in the package.

Build Status

Installation

To use this dataset, first ensure you have a synapse account, then simply install from pip...

pip install ecadataset

and run the download command...

ecadataset download -d path/to/dataset

You'll be prompted for your synapse credentials and the data will be downloaded. You may also check an existing copy of the dataset with the check command...

ecadataset check -d path/to/dataset

Usage

import matplotlib.pyplot as plt
from ecadataset import ECADataset, DataSource, AnnotationType, content_area_hausdorff

# Create dataset object...
dataset = ECADataset(
  # Path to the directory containing the dataset.
  data_directory="path/to/dataset",
  # Options are: DataSource.CHOLEC, DataSource.ROBUST, and DataSource.BOTH.
  data_source=DataSource.BOTH,
  # Options are: AnnotationType.AREA, AnnotationType.MASK, and AnnotationType.BOTH.
  annotation_type=AnnotationType.BOTH,
  # Whether to use cropping to provide additonal samples without a content area.
  include_cropped=True,
  # Whether to include information about where the frame was taken from.
  include_source_info=True
)

# Iterate through the first 10 samples, slicing is supported...
for image, area, mask, info in dataset[:10]:

    # Circular content area represented as (x, y, r) or None if no area present...
    print("Content area: ", area)
    
    # Origin information in the form (dataset, video, frame)...
    print("Sample source: ", info)
    
    # Image and mask are returned as PIL images...
    plt.subplot(121)
    plt.imshow(image)
    plt.subplot(122)
    plt.imshow(mask)
    plt.show()
    
    # Guessing the content area circle and scoring it against the ground truth...
    width, height = image.size
    area_guess = (width//2, height//2, width//2)
    score, _ = content_area_hausdorff(area_guess, area, (height, width))
    print(score)

Metadata

Release files for ecadataset 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecadataset 0.3.4
File Size Uploaded
ecadataset-0.3.4.tar.gz 25.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecadataset 0.3.4
File Interpreter ABI Platform
ecadataset-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 34.4 kB

Release files / ecadataset-0.3.4.tar.gz

Download URL ecadataset-0.3.4.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c7ec8bc1bd2793cfd37dda525642bd6d581cbd365ba4eac4ee5d2c7c2f3252a4
BLAKE2b-256 checksum
How to use checksums
85e3d2a8561d92bef4f539e9a17401d26de9c4eb90c82c4bf04add7ffa92c274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / ecadataset-0.3.4-py3-none-any.whl

Download URL ecadataset-0.3.4-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51924034f7614fae38d44df4dfbf77ad4098705b6115cfb63446966a40b784ff
BLAKE2b-256 checksum
How to use checksums
5f0f996ac562047eb4ba89a333422d1887a553ffbea49d36ae2c264203e9da88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page