MedVisBonn / eyepy

A python package to read, analyse and visualize OCT and fundus data from various sources.
https://medvisbonn.github.io/eyepy/
MIT License
44 stars 8 forks source link

Not fully understand scale_x means. #16

Open big97kai opened 11 months ago

big97kai commented 11 months ago

Description

I want to get the scale_x of oct image, so that i can get the true size of oct (not in pixels)

I notice that in https://medvisbonn.github.io/eyepy/formats/he_e2e_types/Type10004/ it has scale_x and i tried it into on of my e2e file. I'm pretty sure it's nothing like scalue_y ,which means pixel size * scale_y can get the true size.

1024 * 0.9146999716758728 is not 5.9 mm

so what's this scale_x means, and is there any chance i can get true x for e2e file.

Oli4 commented 11 months ago

Hi @big97kai

I once thought I found the x_scale there but figured later that I was wrong and forgot to remove it from the documentation. I'll fix this.

So far I am not aware of anybody who figured out how to extract the x_scale from the E2E files. I am pretty sure that it is not stored in the same form as in the XML or VOL export (x_scale in mm). I have some matching exports and could not find the respective values I got from the XML export in the E2E export. I checked for different encodings and offsets and varying tolerance with respect to the value from the XML.

I assume that E2E only stores measures that allow to derive the x_scale. One of these measures is probably the Scan Focus which is related to the x_scale (here). So I tried to find the Scan Focus in the E2E file but was not successful. Currently, we are stuck here.

If you have any idea what could be stored in the E2E file and want to check for yourself try this to search for arbitrary values in the E2E file:

with ep.io.HeE2eReader(YOURPATH.E2E") as reader:
    hits_float = reader.find_float(0.0039, rtol=0.01, atol=0.0000001, bits=32)
    hits_int = reader.find_int(30, rtol=0.01, atol=0.0000001, bits=32)

The return value is a dictionary

 {"series_id": 
    {foldertype_enum: 
        {"number_encoding": 
            [List of Start bytes in the folder for every hit]
}}}
Oli4 commented 11 months ago

Let's see if we get an answer: https://x.com/oli4morelle/status/1731688684896841805?s=20

big97kai commented 11 months ago

It seems heiderberg doesn't care about researchers. Crying out loud. I notice that there is scale in eyepy is that correct, I mean if that's given by E2E, we can do detect algorithm instead of finding scale_x....