marksgraham / OCT-Converter

Tools for extracting the raw optical coherence tomography (OCT) and fundus data from proprietary file formats.
https://pypi.org/project/oct-converter/
MIT License
193 stars 70 forks source link

Optovue .OCT to dicom conversion #139

Closed T0mSIlver closed 2 months ago

T0mSIlver commented 3 months ago

Hi,

When trying to convert an Optovue .OCT file to dicom, the _validate method of the BOCT class raised a StringError instead of an UnicodeError when parsing the file header structure. I corrected that and then got another error in the write_opt_dicom function : when assigning the value to input_datetime, meta.series_info.acquisition_date was already a datetime.datetime object and not a string. I changed that as well and then the conversion to dicom was successful.

Steps to reproduce : convert Optovue .OCT to dicom with create_dicom_from_oct.

I didn't look into it further but since this is such an easy fix I thought maybe someone would know why this happened.

marksgraham commented 3 months ago

Hey,

The dicom writer is relatively new and has not been tested much for Optovue data, so it's quite possible this is a bug that just hasn't been spotted yet. Feel free to propose a PR to fix this!