OCT-Converter icon indicating copy to clipboard operation
OCT-Converter copied to clipboard

Error while opening E2E files

Open JosefKauer opened this issue 3 years ago • 9 comments

Hey, your converter is a long needed tool. Somehow I have problems to open E2E files using your example E2E code. Everytime, I got this error message:

Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\IPython\core\interactiveshell.py", line 3437, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('C:/Users/josef/Desktop/Nocturne/Development_Projects/Nocturne_Software/OCT-Converter/examples/demo_e2e_extraction.py', wdir='C:/Users/josef/Desktop/Nocturne/Development_Projects/Nocturne_Software/OCT-Converter/examples') File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/josef/Desktop/Nocturne/Development_Projects/Nocturne_Software/OCT-Converter/examples/demo_e2e_extraction.py", line 11, in fundus_images = file.read_fundus_image() # returns a list of all fundus images with additional metadata if available File "C:\Users\josef\Desktop\Nocturne\Development_Projects\Nocturne_Software\OCT-Converter\oct_converter\readers\e2e.py", line 225, in read_fundus_image chunk = self.chunk_structure.parse(raw) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 288, in parse return self.parse_stream(io.BytesIO(data), **contextkw) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 300, in parse_stream return self._parsereport(stream, context, "(parsing)") File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 312, in _parsereport obj = self._parse(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 2120, in _parse subobj = sc._parsereport(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 312, in _parsereport obj = self._parse(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 2653, in _parse return self.subcon._parsereport(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 312, in _parsereport obj = self._parse(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 703, in _parse obj = self.subcon._parsereport(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 312, in _parsereport obj = self._parse(stream, context, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 4832, in _parse data = stream_read(stream, length, path) File "C:\ProgramData\Anaconda3\envs\noct\lib\site-packages\construct\core.py", line 91, in stream_read raise StreamError("stream read less than specified amount, expected %d, found %d" % (length, len(data)), path=path) construct.core.StreamError: Error in path (parsing) -> magic stream read less than specified amount, expected 12, found

JosefKauer avatar Jun 24 '21 13:06 JosefKauer

Hi,

Difficult to know what is going on here. Have you tried multiple volumes with the same error?

marksgraham avatar Jun 25 '21 11:06 marksgraham

Hi, yes I tried several OCT.E2E files from our Spectralis device. I got the same error every time.

JosefKauer avatar Jun 29 '21 12:06 JosefKauer

Hey - are you able to try on linux/mac? And do you know what Spectralis device you're using - is it very new or old?

marksgraham avatar Jul 06 '21 15:07 marksgraham

Hi, yes I tried several OCT.E2E files from our Spectralis device. I got the same error every time.

Hi JosefKauer, I meet the same problem. Have you solved it? StreamError: Error in path (parsing) -> magic stream read less than specified amount, expected 12, found 0

AlanZhang1995 avatar Dec 21 '21 03:12 AlanZhang1995

Hi, I am sorry, I did not further investigated into this matter due to lack of time. So far I did not resolve this issue.

JosefKauer avatar Dec 21 '21 07:12 JosefKauer

Are you able to provide an example .E2E file?

camlloyd avatar Dec 21 '21 11:12 camlloyd

Hi, I am sorry, I did not further investigated into this matter due to lack of time. So far I did not resolve this issue.

That's fine. Thanks for your kind reply.

Are you able to provide an example .E2E file?

Unfortunately, I could not becuase they may not be public data currently. But I do know this E2E file is not a common OCT one. It acutually contains OCTA volumes. Do you have any further idea? Thank you!

AlanZhang1995 avatar Dec 21 '21 17:12 AlanZhang1995

That is OK, although it will be much harder without.

Do you have the newer OCT2/Angiography modules? It would be useful to know if @JosefKauer also does/can share data.

To help with debugging where the parsing is failing, I have opened PR #44, however this is of little use by itself.

You could use a tool such as binwalk to try and extract the image data inside:

$ binwalk -e path/to/.E2E

This might detect JPEG/JFIF signatures - helpful for visualisation, but perhaps not for quantitative analysis. There are likely to be false positives also.

camlloyd avatar Jan 03 '22 17:01 camlloyd

That is OK, although it will be much harder without.

Do you have the newer OCT2/Angiography modules? It would be useful to know if @JosefKauer also does/can share data.

To help with debugging where the parsing is failing, I have opened PR #44, however this is of little use by itself.

You could use a tool such as binwalk to try and extract the image data inside:

$ binwalk -e path/to/.E2E

This might detect JPEG/JFIF signatures - helpful for visualisation, but perhaps not for quantitative analysis. There are likely to be false positives also.

OK, I wil have a try. Thanks for the advice!

AlanZhang1995 avatar Jan 07 '22 06:01 AlanZhang1995