From 0a25815768786155371db7154da84d9cdfc43b3f Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 16 Jul 2019 11:24:20 +0200 Subject: Begin restructuring the data --- src/e2e.h | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'src/e2e.h') diff --git a/src/e2e.h b/src/e2e.h index 72ba8a2..960aa3e 100644 --- a/src/e2e.h +++ b/src/e2e.h @@ -1,10 +1,13 @@ #include +#include #include "eli.h" #define errorf(fmt, ...) (fprintf(stderr, fmt, ##__VA_ARGS__)) -#define IMAGE_FUNDUS 0x02010201 -#define IMAGE_TOMOGRAM 0x02200201 +#define E2E_NONE 0xffffffff + +#define E2E_IMAGE_FUNDUS 0x02010201 +#define E2E_IMAGE_TOMOGRAM 0x02200201 struct e2e_image { size_t size, width, height; @@ -16,7 +19,7 @@ struct e2e_image { }; }; -#define CHUNK_IMAGE 0x40000000 +#define E2E_CHUNK_IMAGE 0x40000000 struct e2e_chunk { const char *origin; @@ -56,11 +59,49 @@ struct e2e_directory { eli_header data_list; }; +struct e2e_slice { + int id; + + struct e2e_image *image; + + UT_hash_handle hh; +}; + +struct e2e_series { + int id; + + struct e2e_slice *slices; + + UT_hash_handle hh; +}; + +struct e2e_study { + int id; + + struct e2e_series *series; + + UT_hash_handle hh; +}; + +struct e2e_patient { + int id; // FIXME: hopefully this doesn't overflow... + + struct e2e_study *studies; + + UT_hash_handle hh; +}; + struct e2e_data { + // file buffer const char *start, *end; + // E2E structure struct e2e_directory *dirs; + + // logical structure + struct e2e_patient *patients; }; + int e2e_read(struct e2e_data *data, const char *start, const char *end); void e2e_destroy(struct e2e_data *data); -- cgit