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
195 stars 70 forks source link

The width and height of the image file are different #56

Closed koon-kai closed 2 years ago

koon-kai commented 2 years ago

Hi, I use the FDA format file to export png images, and then found the width and height are not the same as the one exported with OCT software。 Where are the width and height of the exported image format set? Or does the source file have original information about width and height?

Looking forward to your help, thanks.

marksgraham commented 2 years ago

Hi,

The width and height of OCT slices are read here https://github.com/marksgraham/OCT-Converter/blob/75b84c4375adad04f8b122fa51e244b5b4f487de/oct_converter/readers/fda.py#L108 and stored in oct_header.width and oct_header.height.

How different are they from those exported via the topcon software? Are you able to send me an example file?

Mark

koon-kai commented 2 years ago

Hi,

The width and height of OCT slices are read here

https://github.com/marksgraham/OCT-Converter/blob/75b84c4375adad04f8b122fa51e244b5b4f487de/oct_converter/readers/fda.py#L108

and stored in oct_header.width and oct_header.height. How different are they from those exported via the topcon software? Are you able to send me an example file?

Mark

Hi Mark, Thank you for your reply. I have seen the source code here, it seems that it directly reads the information of the oct_header of the FDA file?

so I can't change it?

https://www.dropbox.com/sh/1mq1jywstjk3trg/AADxmvnkw1HbKdFCmEE0WXr6a?dl=0 the above link is an example.

Thank you for your time again.

marksgraham commented 2 years ago

Hi,

Yes, it reads it from the FDA file. Looking at the images you shared, it looks like OCT-converter has read the data correctly as it is stored in the .fda, as there don't seem to be any read artefacts in the image. It's possible Topcon's software has done some post-processing of the data to get it into the more rectangular format, or perhaps it is reading the data from a different part of the file that I don't know how to access.

OCT-converter gives you the raw data as a numpy array so you could always do some image resizing yourself if you wanted to get a different image ratio.

koon-kai commented 2 years ago

I understand, thanks a lot.