summaryrefslogtreecommitdiff
path: root/src/e2e.h
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-07-16 11:24:20 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-07-16 11:24:20 +0200
commit0a25815768786155371db7154da84d9cdfc43b3f (patch)
tree7a185bf6ca52bf5cebfe0c4398b7fa55e281172e /src/e2e.h
parent581f08da5335122ca04afc3d59c2ec1861290c6a (diff)
Begin restructuring the data
Diffstat (limited to 'src/e2e.h')
-rw-r--r--src/e2e.h47
1 files changed, 44 insertions, 3 deletions
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 <inttypes.h>
+#include <uthash.h>
#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);