Skip to main content

Extract OCT and fundus data from proprietary file formats.

Project description

OCT Converter

Python-based tools for reading OCT and fundus data.

Description

In ophthalmology, data acquired from the scanner is often exported in the manufacturer's proprietary file format. OCT-Converter provides python-based tools for extracting images (optical coherence tomography and fundus), as well as associated metadata, from these files.

Supported file formats

  • .fds (Topcon)
  • .fda (Topcon)
  • .e2e (Heidelberg)
  • .img (Zeiss)
  • .oct (Bioptigen)
  • .OCT (Optovue)
  • .dcm

Installation

Requires python 3.7 or higher.

pip install oct-converter

Usage

A number of example usage scripts are included in examples/.

Here is an example of reading a .fds file:

from oct_converter.readers import FDS

# An example .fds file can be downloaded from the Biobank website:
# https://biobank.ndph.ox.ac.uk/showcase/refer.cgi?id=30
filepath = '/home/mark/Downloads/eg_oct_fds.fds'
fds = FDS(filepath)

oct_volume = fds.read_oct_volume()  # returns an OCT volume with additional metadata if available
oct_volume.peek(show_contours=True) # plots a montage of the volume, with layer segmentations is available
oct_volume.save('fds_testing.avi')  # save volume as a movie
oct_volume.save('fds_testing.png')  # save volume as a set of sequential images, fds_testing_[1...N].png
oct_volume.save_projection('projection.png') # save 2D projection

fundus_image = fds.read_fundus_image()  # returns a  Fundus image with additional metadata if available
fundus_image.save('fds_testing_fundus.jpg')

metadata = fds.read_all_metadata(verbose=True) # extracts all other metadata
with open("fds_metadata.json", "w") as outfile:
    outfile.write(json.dumps(metadata, indent=4))

# create and save a DICOM (.fda/.fds only for now)
dcm = create_dicom_from_oct(filepath)

Contributions

Are welcome! Here is a development roadmap, including some easy first issues. Please open a new issue to discuss any potential contributions.

Updates

22 September 2023

  • DICOM support: can now save .fda/.fds files as DICOMs with metadata populated.

28 March 2023

  • Metadata extraction for .fds expanded to match that of .fda file.

31 January 2023

  • Greatly extended support for extracting metadata from .fda files.

7 August 2022

  • Contours (layer segmentations) are now extracted from .e2e files.
  • Acquisition date is now extracted from .e2e files.

16 June 2022

  • Initial support for reading Optovue OCTs.
  • Laterality is now extracted separately for each OCT/fundus image for .e2e files.
  • More patient info extracted from .e2e files (name, sex, birthdate, patient ID).

24 Aug 2021

  • Reading the Bioptigen .OCT format is now supported/

11 June 2021

  • Can now specify whether Zeiss .img data needs to be de-interlaced during reading.

14 May 2021

  • Can save 2D projections of OCT volumes.

30 October 2020

  • Extract fundus and laterality data from .e2e
  • Now attempts to extract additional volumetric data from .e2e files that was previously missed.

22 August 2020

  • Experimental support for reading OCT data from .fda files.

14 July 2020

  • Can now read fundus data from .fda files.

Related projects

  • uocte inspired and enabled this project
  • LibE2E and LibOctData provided some additional descriptions of the .e2e file spec
  • eyepy for python-based import, visualisation, and analysis of OCT data
  • eyelab is a tool for annotating this data

Clinical use

We can't guarantee images extracted with OCT-Converter will match those extracted or viewed with the manufacturer's software. Any use in clinical settings is at the user's own risk.

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

oct_converter-0.6.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

oct_converter-0.6.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file oct_converter-0.6.0.tar.gz.

File metadata

  • Download URL: oct_converter-0.6.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for oct_converter-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2ad97db7387abacee4f9b350a5228c47257e4924e48ba2d62de98040e1c6481e
MD5 5548c9101ac0a75e06d434cf5a60e9ea
BLAKE2b-256 1c186f6b3e17f0e738e3b251355769f13213e3337e40e4510d193f26bcb215cc

See more details on using hashes here.

Provenance

File details

Details for the file oct_converter-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for oct_converter-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e10780c9012392a5b18f3296ff653761caf8ef3d25d6422657e3ed46d541fffc
MD5 7ecdf6d0a59765ec9b3676012348c07e
BLAKE2b-256 7d017a5151fbf6a24a563ad72ae1a8d3fcd155326585cdc4e5df0c6c681bbc1b

See more details on using hashes here.

Provenance

Supported by

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