-
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
(E2E-Export) .avi not exported properly + images darker #21
Comments
Hi there,
|
Hi Mark, thank you very much for your reply. Regarding 1) I will try that out but even if this will work out for me, however I believe issue 2) is critical for my application as I'm primarily need to provide the data for manual examination. So if this issue cannot be resolved, solving 1) isn't gonna help, unfortunately. |
Hi, To change the .e2e scaling, you would want to change this line in the code: OCT-Converter/oct_converter/readers/e2e.py Line 161 in c335a40
where each pixel is raised to the power of 1/2.4 and multiplie by 256. Changing the power and the 256 scaling factor would adjust the brightness. I took this from uocte (https://bitbucket.org/uocte/uocte/src/8ed70b7ecd5c92cbbfaac281fe090cf7136cba6d/src/io/load_heidelberg.cpp#lines-210) but i'm not sure what their rationale was. I don't think I've ever been able to directly compare .e2e extracted from heidelberg's software to data extracted from mine, so you could be in a good position to compare and see if this can be improved. Would you be able to have a play and see if this fixes your problem? |
Hi Mark, thanks for pointing out the code line to change the brightness for the resulting pictures. Right now I'm trying to experiment with the values and comparing the resulting images to the image displays in heidelberg's software. Another thing I'm noticing during this process is that the number of slides exported seem to be doubled in comparison to the number of slides in the heidelberg software. Unfortunately, I cannot help myself what's the reason behind this and therefore comparing the results is a little bit inaccurate. |
That is strange. Is there any way you would be able to share a .e2e file with me, and the corresponding scans exported in HEYEX, for me to take a look at? |
I have resolved the problem with the number of slides and there was a mistake on my side. |
I believe that "arbitrary" exponentiation of the pixels (gamma) is used to decompress the distribution of the floating point representation: This is the .tif of one frame exported from the heidelberg system, which has an interesting distribution of intensities and may be a clue for us. You can get images that match reasonably well using the smaller gamma and clipping the bottom 50% of the pixels , but the smaller gamma also amplifies those periodic spikes. Interestingly, if we fourier transform, clip 50%, and then iFFT, we get pretty good results, with a distribution dependent on the gamma we chose: Will need to keep experimenting. |
Really interesting. I think as a minimum we could allow users to set the gamma value as an argument so they experiment with how this might affect their data. |
I had a similar problem when working with the HEYEX VOL export, where I found the intensity transformation to be logarithmic. If the E2E data is the same as in the VOL file the following function might help: def vol_intensity_transform(data):
selection_0 = data == np.finfo(np.float32).max
selection_data = data <= 1
new = np.log(data[selection_data] + 2.44e-04)
new = (new + 8.3) / 8.285
data[selection_data] = new
data[selection_0] = 0
data = np.clip(data, 0, 1)
return img_as_ubyte(data) I found the output to differ by at most +/- 3 when compared with the XML export of the same volume for my small sample dataset. This difference arises from the same intensity in VOL data having multiple intensities in the XML data (See images below). There might be an additional context-sensitive processing step? Plotted XML intensities(y-axis) againts VOL intensities (x-axis) Zoom in on the plotted intensities. If you are interested in reading the HEYEX VOL or XML export which do not seem to be supported by the OCT-converter, have a look at my package eyepy |
Thanks @Oli4 |
@marksgraham This would be great :) I will do so as well! |
Dear @marksgraham, |
Hi @Oli4 , |
This helped me a lot thanks. the results are so promising |
Hi all, I've finally got around to addressing this, making use of @Oli4's intensity transform suggested above. The contrast of extracted .e2e files now seems much better. It's available in the latest version, v0.5.8. If you want the old behaviour, you can use the flag |
Hi There!
First of all, thank you Mark for your work!
I was trying out your implementation for converting Heidelberg's E2E format to images and videos, respectively.
I can execute your example file with my exported E2E-file from HEYEX (v1) but there seem to be 2 problems:
The resulting .avi file seems to consist only of one image, although in the step where all slides get displayed through the
volume.peek()
code line, the images of the slides are all different.The converted images of the slides seem to be a bit darker than what I see in the HEYEX software. Therefore, some areas of the slides are not displayed very detailed. However, I'm not sure how significant this problem is as I'm not an ophthalmologist nor do I have any kind of medical background.
Thanks for your help!
The text was updated successfully, but these errors were encountered: