Open ivanslootweg opened 1 year ago
What seems to fix is the following edit here:
elif chunk.type == 11: # laterality data
raw = f.read(20)
try:
laterality_data = e2e_binary.lat_structure.parse(raw)
if laterality_data.laterality == 82:
laterality = "R"
elif laterality_data.laterality == 76:
laterality = "L"
volume_string = "{}_{}_{}".format(
chunk.patient_id, chunk.study_id, chunk.series_id
)
if laterality and volume_string not in laterality_dict:
laterality_dict[volume_string] = laterality
except Exception:
laterality = None
whilst commenting out:
# # here assumes laterality stored in chunk before the image itself
# if laterality and volume_string not in laterality_dict:
# laterality_dict[volume_string] = laterality
in line 239
Hi @ivanslootweg
Thanks for raising this. I wasn't sure how to associate laterality chunks to imaging chunks when implementing this, so I guessed and checked it worked out with the few scans I had available to me.
It could well be your approach is better, but I might leave this issue open a while and see if anyone else has any opinions/experiences they can weigh in with before I go ahead and change the code.
Sure, no problem. Thank you for considering!
For my heidelberg OCT dataset, I am reading the following e2e scans: ONH (Retina) - dimensions 384x496, 73 slices; Macula (Choroid) - dimensions 512x496, 25 slices; Macula (Retina) - dimensions 52x496, 49 slices;
Upon reading the volumes, volume.Laterality wrongfully always returns "L" for all ONH scans. Before the recently updated e2e reader, I had slightly modified the read_oct_volume() method in e2e.pyto extract more metadata, which correctly returned laterality.
So far I cannot locate the problem of this issue myself, I will share my code for e2e.py :