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

Acquisition Date for .e2e files

Open rubeenmp opened this issue 1 year ago • 3 comments

Hi everyone,

First of all, thanks @marksgraham for taking the time to build this amazing OCT-converter.

My question is related to the acquisition date for .e2e OCTs. Neither your OCT-converter nor the original website from the uocte project seems to provide a hint to obtain it: https://bitbucket.org/uocte/uocte/wiki/Heidelberg%20File%20Format

Is there anyone who has been able to extract the acquisition date for the .e2e format? Or at least has a hint at where it could be?

Thanks

rubeenmp avatar Jul 22 '22 10:07 rubeenmp

Hi there,

I've been trying to extract this recently. The most progress I've made is that I can extract birthdate https://github.com/marksgraham/OCT-Converter/blob/11bdf6a3297d5414c9436aa4e6981af2e7268923/oct_converter/readers/e2e.py#L179 which, as is stated in the uocte link you shared, is a Julian date which means it should be able to be converted to a date using e.g. https://www.onlineconversion.com/julian_date.htm

Given that, maybe we can assume acquisition date is a Julian date, too. I've tried converting known acquisition dates to Julian and scanning through the full file to find them, but with no luck. But I may not be doing it right..!

marksgraham avatar Jul 26 '22 21:07 marksgraham

Hi @marksgraham, Thanks for your massive effort on this repo in general. I am also trying to find a way to retrieve scan date from e2e. Just commented here in order to stay in loop. Thanks!

gihants avatar Jul 28 '22 01:07 gihants

Hi @rubeenmp and @gihants, I think I've managed to extract scan date. I'm not 100% my implementation is correct - let me know if you manage to test it out. It isn't released on PyPi just yet, so you'll need to clone the repo.

marksgraham avatar Aug 07 '22 17:08 marksgraham

This feature is in the version on PyPi now

marksgraham avatar Aug 16 '22 20:08 marksgraham

Hi @marksgraham, great work.

I was able to extract it also using the study date proposed in LIBE2E and realised it correlated perfectly with the actual scan date. I suppose that you have similarly linear regressed the acquisition time with the actual scan date and after seeing that they correlated perfectly, subtracted the acquisition time (*1e-7 to obtain valid datetime values) from them to obtain the date of 31/12/1600 (https://bitbucket.org/uocte/uocte/issues/3/heidelberg-reader-does-not-read-aquisition).

Is that the way you have extracted it? If so, how did you manage to obtain the hour 23:59?

By the way, I have test it with some scans of mine and it works fine.

Thanks.

rubeenmp avatar Aug 30 '22 11:08 rubeenmp

Hi,

Correct, that is how I extracted it. When doing the regression from a few scans with different acquisition dates I got 31/12/1600 and 23:59. I agree the time seems a bit strange (surely more likely to be midnight?) but given I was just interested in the acquisition date it didn't seem too important. I've actually since been linked to the actual extraction code (https://github.com/neurodial/LibE2E/issues/5) for both scan date and acquisition time, so I'll implement those at some point, but the current solution seems 'good-enough' for now.

Mark

marksgraham avatar Aug 30 '22 14:08 marksgraham

Hello there,

Yes, more than good-enough. Great work. As I have said previously, the actual scan date can also be extracted from the windowsStudyDate (LibE2E) using the same problem resolution logic.

Thanks.

rubeenmp avatar Aug 30 '22 14:08 rubeenmp