-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading e2e metadata #117
Comments
Great tool. i'm looking for a way to get dx, dy and dz. More generally i need the output avi file with two parts - left: the fundus with lines that are presenting the scaned frame and the bscans. right - the bscans |
Hi @ilannotal Starting with the metadata - it should be read as part of the bscan_metadata header. Are you able to check if any of the elements of this field match with the values available in the scanner when they're read at this point. If so, we'll need to work on a way of saving them as part of the OCTVolume class. |
Hi Mark, Thank you for your response. |
Dear Ilan, the scale returned by OCT-converter called scaley is the scale for the height of the B-scan. The Heidelberg Viewer calls it Z because X and Y are the same directions as used for the fundus image and Z is the depth added for the OCT. I spend quite some time figuring out the E2E format for eyepy and documented my findings which might be helpful to you here: https://medvisbonn.github.io/eyepy/formats/he_e2e/ Unfortunately I was not able to find the x scaling and the intra-volume registration information (Actually I just found in my documentation for the B-scanmeta a field I called scale_x so maybe I found something there but forgot, but it could also be that this was a mistake and I should fix the documentation there because as of what I remember from when I worked on this the x-scale was still missing). Since the exact x-scaling (width) of the B-scans depends on the measured eye. (I am not sure but probably the length of the eye and maybe other factors) it might be calculated on the fly by the Heidelberg Viewer. Another possibility is that it is stored not in the B-scan meta data but some other container in the E2E format. For finding the position of the B-scans on the fundus I use a heuristic because I couldn't find the positions (https://github.com/MedVisBonn/eyepy/blob/1b5bb954ab4deb90c1e99ac2111606495680c100/src/eyepy/io/he/e2e_reader.py#L323). Positions in the Metadata seem to be given relative the the center of the scan (There are negative values) so I add the min value I found for one example and scale it. This approach might fail for other scans. Let me know if I can help. It would be great to finally find the missing information and many projects would benefit from it. Best Olivier |
So more suggestion that the size along x is not stored in the actual .e2e image: neurodial/LibE2E#4 Looks like it might be able to be calculated using the posx1,posx2, which seem to be in degrees, and a fixed constant.. |
Hi, It's looks like, we must exchange 'imgsizeX' and 'imgsizeY' in OCT-Converter, because the X axis is 512 for the Bscans and the Y axis is 496. You may see that if we multiply 'ImagesizeY' (496) by 'scaley' (0.00387) - we get 1.91 (mm), which is 'Size Z', of the viewer (for us it's Y). what do you think about this? In the same way, if we take 'Size X' of the viewer (5.9 mm) and we divide it by 512 - we get 0.01152, which must be 'scalex'. according to the viewer, the value is 0.01158. very close. But, we used 'Size X' of the viewer. |
Hi @ilannotal You may be right, though in the spreadsheet you shared size x is 5.8 which would get scalex=0.01132. Still pretty close to scaleX though. Do you happen to have another scan with different parameters we could double check this on before we make the change? |
Here is another image, but with very close parameters. Size X * Scaling X = 512 * 11.58 = 5928.96 ~ 5.9 mm. |
Ok happy to change it round then! |
Want to make a PR? |
No, you may change it. Thank you
השג את Outlook עבור iOS<https://aka.ms/o0ukef>
…________________________________
מאת: Mark Graham ***@***.***>
נשלח: Tuesday, June 27, 2023 11:57:50 PM
אל: marksgraham/OCT-Converter ***@***.***>
עותק: Ilan Hadas ***@***.***>; Mention ***@***.***>
נושא: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
Want to make a PR?
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VJAV2QPPWGJ5EWU443XNNCM5ANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
Done |
Hi Mark,
Great.
Another question. Do you think that PosY1 and PosY2 are also degrees? Did you get the bscans order from those values?
Ilan
Ilan Hadas
Data Analyst
Notal Vision, Ltd.
5 Droyanov St., Tel Aviv, Israel
Office: +972-3-6213800 | Cell: +972-52-5345961
***@***.******@***.***> | www.notalvision.com<http://www.notalvision.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/notal-vision>
***@***.***
From: Mark Graham ***@***.***>
Sent: Wednesday, June 28, 2023 5:02 PM
To: marksgraham/OCT-Converter ***@***.***>
Cc: Ilan Hadas ***@***.***>; Mention ***@***.***>
Subject: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
Done
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VPCJLQPJA2XWGVJ6ATXNQ2ODANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
I don't make use of posX/posY, and don't know if they are in degrees - any idea @Oli4 ? I get the slice order from the OCT-Converter/oct_converter/readers/e2e.py Lines 224 to 226 in 8c04fb3
|
Hi,
Thank you,
posX2-posX1 is always 20 and 20 is the Scan angle of the OCT Image in degrees according to the viewer.
posY1 is also moving from -10 to 10 and posY2 is very close to posY2 (I suppose that if it’s the same the Bscan is exact horizontal). So again it’s 20 like the scan angle.
I think you may find the order also in ‘aktImage’ of ‘bscan_data’.
ilan
Ilan Hadas
Data Analyst
Notal Vision, Ltd.
5 Droyanov St., Tel Aviv, Israel
Office: +972-3-6213800 | Cell: +972-52-5345961
***@***.******@***.***> | www.notalvision.com<http://www.notalvision.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/notal-vision>
***@***.***
From: Mark Graham ***@***.***>
Sent: Thursday, June 29, 2023 10:37 PM
To: marksgraham/OCT-Converter ***@***.***>
Cc: Ilan Hadas ***@***.***>; Mention ***@***.***>
Subject: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
I don't make use of posX/posY, and don't know if they are in degrees - any idea @Oli4<https://github.com/Oli4> ?
I get the slice order from the slice_id key for each chunk a bscan is read from:
https://github.com/marksgraham/OCT-Converter/blob/8c04fb3b3718b0b229dbb1c1b442cdbff423aac0/oct_converter/readers/e2e.py#L224-L226
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VLLYUI4KA6N2PLCPFLXNXKOPANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
I had this in mind once although it is not implemented in the eyepy E2E Reader. I had scans with an angle of 30° and the start and end positions were also adding up correctly. I think my problem was, that I could not figure out how to derive the x-scale from that. Therefore I think we would need the distance from the retina to the sensor and maybe a correction factor accounting for physiological differences in subjects. |
Hi,
I think we must exchange ‘image_data_height’ with ‘image_data_width’ here:
https://github.com/marksgraham/OCT-Converter/blob/8c04fb3b3718b0b229dbb1c1b442cdbff423aac0/oct_converter/readers/binary_structs/e2e_binary.py#L60-L65
because in:
https://github.com/marksgraham/OCT-Converter/blob/8c04fb3b3718b0b229dbb1c1b442cdbff423aac0/oct_converter/readers/e2e.py#L192-L1923
we get the 1st as 512 and the 2nd as 496, while we know it’s the opposite.
Right now, it make no harm because here:
https://github.com/marksgraham/OCT-Converter/blob/8c04fb3b3718b0b229dbb1c1b442cdbff423aac0/oct_converter/readers/e2e.py#L204-L205
LUT[raw_volume].reshape(image_data.width, image_data.height
the parameters are first the width and then the raw, while it must be the opposite.
Ilan
Ilan Hadas
Data Analyst
Notal Vision, Ltd.
5 Droyanov St., Tel Aviv, Israel
Office: +972-3-6213800 | Cell: +972-52-5345961
***@***.******@***.***> | www.notalvision.com<http://www.notalvision.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/notal-vision>
***@***.***
From: Mark Graham ***@***.***>
Sent: Thursday, June 29, 2023 10:37 PM
To: marksgraham/OCT-Converter ***@***.***>
Cc: Ilan Hadas ***@***.***>; Mention ***@***.***>
Subject: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
I don't make use of posX/posY, and don't know if they are in degrees - any idea @Oli4<https://github.com/Oli4> ?
I get the slice order from the slice_id key for each chunk a bscan is read from:
https://github.com/marksgraham/OCT-Converter/blob/8c04fb3b3718b0b229dbb1c1b442cdbff423aac0/oct_converter/readers/e2e.py#L224-L226
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VLLYUI4KA6N2PLCPFLXNXKOPANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
I suppose you’re right. Do you have any assumption for this distance?
Ilan Hadas
Data Analyst
Notal Vision, Ltd.
5 Droyanov St., Tel Aviv, Israel
Office: +972-3-6213800 | Cell: +972-52-5345961
***@***.******@***.***> | www.notalvision.com<http://www.notalvision.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/notal-vision>
***@***.***
From: Olivier Morelle ***@***.***>
Sent: Friday, June 30, 2023 2:49 PM
To: marksgraham/OCT-Converter ***@***.***>
Cc: Ilan Hadas ***@***.***>; Mention ***@***.***>
Subject: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
I had this in mind once although it is not implemented in the eyepy E2E Reader. I had scans with an angle of 30° and the start and end positions were also adding up correctly. I think my problem was, that I could not figure out how to derive the x-scale from that. Therefore I think we would need the distance from the retina to the sensor and maybe a correction factor accounting for physiological differences in subjects.
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VMOBGP2EGZDUS24XUTXN24KJANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
I've exchanged height and width in the e2e binary. Is this distance from retina to sensor not viewable anywhere in the Heidelberg viewer? If we know what value we're looking for it might be possible to search in the .e2e binary |
Hi,
This is what we get from the viewer. Here we have Size X and Scaling X, but I couldn’t file these values in the code output.
General Parameters
Resolution Mode: High Speed
Scan Focus: -0.52 D
Camera Objective: Standard 2
Internal Target: Middle
External Target: OFF
Examination Time: 10:21:39 (UTC)
Examined Structure: Retina
Application: Retina
IR Image
Scan Angle: 30°
Size X: 768 pixels (8.9 mm)
Size Y: 768 pixels (8.9 mm)
Scaling: 11.58 µm/pixel
ART Mode: ON (100 images averaged)
ART Normalization: ON
Sensitivity (DC/DC): 86%
Total Sensitivity: 48
IR Laser Power: 100%
Filter State: FA Filter
Lookup Table: Linear
ERG Mode: OFF
Auto-Brightness State: OFF
Grey Value Offset: 0
OCT Image
Scan Angle: 20°
Size X: 512 pixels (5.9 mm)
Size Z: 496 pixels (1.9 mm)
Scaling X: 11.58 µm/pixel
Scaling Z: 3.87 µm/pixel
ART Mode: ON (9 images averaged)
Eye Length: Medium
Quality: 24 dB
EDI Mode: OFF
Acquisition Time: 10:21:42 (UTC)
OCT Scan Pattern
Number of B-Scans: 49
Pattern Size: 20° x 20° (5.9 x 5.9 mm)
Distance between B-Scans: 123 µm
Device
Camera Model: Spectralis HRA+OCT
Camera Model Code: S3600-IFP
Camera S/N: 005531
Power Supply S/N: 005581
Touch Panel S/N: 004095
HRA Camera FW Version: 2.7.5.0
Power Supply FW Version: 1.5.5.0
Touch Panel FW Version: 1.6.0.0
OCT Camera FW Version: 1.51.0.0
OCT Controller FW Version: 1.4.6.0
OCT Camera FPGA Version: 1.41.0.0
Acquisition Software Version: 6.12.4.0
Ilan
Ilan Hadas
Data Analyst
Notal Vision, Ltd.
5 Droyanov St., Tel Aviv, Israel
Office: +972-3-6213800 | Cell: +972-52-5345961
***@***.******@***.***> | www.notalvision.com<http://www.notalvision.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/notal-vision>
***@***.***
From: Mark Graham ***@***.***>
Sent: Monday, July 3, 2023 8:27 PM
To: marksgraham/OCT-Converter ***@***.***>
Cc: Ilan Hadas ***@***.***>; Mention ***@***.***>
Subject: Re: [marksgraham/OCT-Converter] Reading e2e metadata (Issue #117)
I've exchanged height and width in the e2e binary. Is this distance from retina to sensor not viewable anywhere in the Heidelberg viewer? If we know what value we're looking for it might be possible to search in the .e2e binary
—
Reply to this email directly, view it on GitHub<#117 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4DQ7VKY2QO7A3G7V47MTSDXOL6FVANCNFSM6AAAAAAZOR3C5A>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
This e-mail message and any documents transmitted as attachments may contain confidential information that is legally privileged under state and federal law. This information is intended only for the sole use of the individual or entity to which it is addressed above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this email transmission and any attached files or documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by reply email and delete or destroy all copies of the original message.
|
The question is whether this distance is constant |
I think you'd have to empirically estimate a distance from retina from known values of scan angle/scalex and then see if that distance holds across a number of different scans |
I consulted with a colleague and he advised to take a degree as 300 µm and not to deal with the distance. This solve for us the challenge of dx, and dy (we already have dz) , And because we have posY1 for each bscan we know also the width between bscans. We also know the location of the bscans on the fondus. |
Keep in mind that these are probably mean values of a distribution following the normal distribution even for healthy eyes not considering Degeneration. I once evaluated the voxel sizes for a oct dataset from spectralis were varying voxel sizes are reported. I try to find and post it here so you can figure out for yourself whether the additional variance is ok for your task. |
Does anyone noticed that their a problem with slices order in volume. when comparing it to .AVI output of Heidelberg viewer, i found out that the last slice in the converter is actually the first one in the viewer and each slice need to move forward in one place. |
Hi, I don't have access to a ground truth from the scanner, so I can't confirm this. Are you able to confirm this is the case with several scans? |
Discussed in #28
Originally posted by BLMeltdown June 16, 2021
HI, thanks for this very interesting tool.
Is it possible to read metadata for the exam, especially for e2e exams, please?
Thanks
Best regards
Laurent
The text was updated successfully, but these errors were encountered: