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
200 stars 72 forks source link

fundus jpg looks wrong; the .avi is just "static noise" and the dicom function doesn't work from the example #145

Open skirsch opened 3 months ago

skirsch commented 3 months ago

I did everything by the book for the demo. I downloaded the exact sample image file and ran the sample code.

There were 3 big problems:

  1. the .avi movie was just "static noise"
  2. the fundus image was largely black, not like the sample image at all fds_testing_fundus

And the dcm version was unreadable: image

  1. Output from last part of the example script:
    >>> metadata = fds.read_all_metadata(verbose=True)
    b'@IMG_SCAN_03' there is no method for getting info from this chunk.
    b'@PARAM_TRC_02' there is no method for getting info from this chunk.
    >>> with open("fds_metadata.json", "w") as outfile:
    ...     outfile.write(json.dumps(metadata, indent=4))
    ...
    Traceback (most recent call last):
    File "<stdin>", line 2, in <module>
    NameError: name 'json' is not defined
    >>> dcm = create_dicom_from_oct(filepath)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'create_dicom_from_oct' is not defined

    everything else worked.

It appears there was a missing:

from oct_converter.dicom import create_dicom_from_oct

from the example script?

marksgraham commented 3 months ago

I think the fundus might just be that bad quality

Can you try export as a series of .png rather than .avi by changing the extension type and see if it still just looks like noise?

The import was missing from the README script, thanks for spotting, you can find the fuller example here: https://github.com/marksgraham/OCT-Converter/blob/main/examples/demo_fds_extraction.py

skirsch commented 2 months ago

exporting as series of .png worked, it's just that the .avi should have played flawlessly and it was just noise. maybe people aren't trying this... the sample file takes FOREVER to download due to the place you have it hosted.

I have a 10G connection and could host the file on my website if you like (and would be willing to list in in the documentation so people know about it).

marksgraham commented 2 months ago

I suspect people don't use avi export too much, but it does work for me... I wonder if it is something about video codecs.

The file is hosted by the UK biobank, not by me, and it downloaded in a few seconds when I just tried!

On Sat, Sep 14, 2024 at 8:02 PM Steve Kirsch @.***> wrote:

exporting as series of .png worked, it's just that the .avi should have played flawlessly and it was just noise. maybe people aren't trying this... the sample file takes FOREVER to download due to the place you have it hosted.

I have a 10G connection and could host the file on my website if you like (and would be willing to list in in the documentation so people know about it).

— Reply to this email directly, view it on GitHub https://github.com/marksgraham/OCT-Converter/issues/145#issuecomment-2351108396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4UIM2UV2SB6EHCCG46QZLZWSB3PAVCNFSM6AAAAABMMQU6PSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGEYDQMZZGY . You are receiving this because you commented.Message ID: @.***>

skirsch commented 1 month ago

ok. so all i'm saying is I couldn't replicate the images using that data. were you able to?