From c6c6d12acea4bca05fdf497912f7d8431e61472c Mon Sep 17 00:00:00 2001
From: sharoncy <s.c.yates@medisin.uio.no>
Date: Sat, 27 May 2023 09:38:02 +0200
Subject: [PATCH] Added create_test_data.py

---
 PyNutil/testing_openflatfile.py | 13 +++++++++++--
 test_data/create_test_data.py   |  0
 2 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 test_data/create_test_data.py

diff --git a/PyNutil/testing_openflatfile.py b/PyNutil/testing_openflatfile.py
index e6e630e..f37a324 100644
--- a/PyNutil/testing_openflatfile.py
+++ b/PyNutil/testing_openflatfile.py
@@ -32,13 +32,22 @@ with open(base, "rb") as f:
     image_arr = cv2.resize(image_arr,(9848,12784),interpolation=cv2.INTER_NEAREST)
     print(image_arr.shape)
     val,count = np.unique(image_arr, return_counts=True)
-    print(list(zip(val,count)))
 
 # show image with plt.imshow(image_arr)
 
 """assign label file values into image array"""
 
-labelfile = pd.read_csv(r"../metadata/annotation_volumes\allen2017_colours.csv")
+labelfile = pd.read_csv(r"metadata/annotation_volumes\allen2017_colours.csv")
+labelfile[]
+print(list(zip(val,count)))
+
+
+temp_copy = labelfile.loc[val.astype(int),:].copy()
+
+temp_copy['region areas'] = count
+
+temp_copy.to_csv('../outputs/region_areas_quick_test.csv',sep=';')
+
 allen_id_image = np.zeros((h, w))  # create an empty image array
 
 """for ph in range(h):
diff --git a/test_data/create_test_data.py b/test_data/create_test_data.py
new file mode 100644
index 0000000..e69de29
-- 
GitLab