Skip to main content

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.dicom import create_dicom_from_oct
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
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

9 November 2023

  • Can now save .e2e, .img, .oct, and .OCT files as DICOMs with correct headers.

22 September 2023

  • DICOM support: can now save .fda/.fds files as DICOMs with correct headers.
  • Much more complete extraction of .fda/.fds metadata.

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.

Metadata

Release files for oct-converter 0.7.0

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

Source distribution (sdist)

Source distribution for oct-converter 0.7.0
File Size Uploaded
oct_converter-0.7.0.tar.gz 42.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oct-converter 0.7.0
File Interpreter ABI Platform
oct_converter-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 101.8 kB

Release files / oct_converter-0.7.0.tar.gz

Download URL oct_converter-0.7.0.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fafd0ad08266c2d2f07248ea3340d7b4b714d5fddc97325f314cdcb2e02c49b3
BLAKE2b-256 checksum
How to use checksums
437d4f34f8bac81612ed3bcf542742720374bbd41343b03a0ffc85d3c3100b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / oct_converter-0.7.0-py3-none-any.whl

Download URL oct_converter-0.7.0-py3-none-any.whl
Size 59.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12427f99a9bd0ae08cc2ee2484a059ea21cceb3e16185937361b91872d635e51
BLAKE2b-256 checksum
How to use checksums
e6754a695484094d0216795a984d49c6a0d1600e3ea5e1dc19d8268baa442195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

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