#include #include "eli.h" #define errorf(fmt, ...) (fprintf(stderr, fmt, ##__VA_ARGS__)) #define IMAGE_FUNDUS 0x02010201 #define IMAGE_TOMOGRAM 0x02200201 struct e2e_image { size_t size, width, height; uint32_t type; union { const uint8_t *fundus; float *tomogram; }; }; #define CHUNK_IMAGE 0x40000000 struct e2e_chunk { const char *origin; const struct e2e_entry *entry; size_t size; uint32_t patient_id, study_id, series_id, slice_id, ind; uint32_t type; union { struct e2e_image image; }; }; struct e2e_entry { const char *start; size_t size; uint32_t patient_id, study_id, series_id, slice_id, type; _Bool has_chunk; struct e2e_chunk chunk; }; struct e2e_fundus { size_t size, width, height; uint32_t type; }; struct e2e_directory { const char *current, *next; size_t num_entries; struct e2e_entry *entries; eli_header data_list; }; struct e2e_data { const char *start, *end; struct e2e_directory *dirs; }; int e2e_read(struct e2e_data *data, const char *start, const char *end); void e2e_destroy(struct e2e_data *data);