From 23907bf060e1499165ea9c83b1d4ee0f1d54b271 Mon Sep 17 00:00:00 2001
From: Mark Winter <mwinter@drexel.edu>
Date: Tue, 28 Sep 2021 23:30:57 +0200
Subject: [PATCH] Added simple python usage example using scikit-image

---
 src/Python/test_cells3d.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/Python/test_cells3d.py

diff --git a/src/Python/test_cells3d.py b/src/Python/test_cells3d.py
new file mode 100644
index 0000000..1f42e53
--- /dev/null
+++ b/src/Python/test_cells3d.py
@@ -0,0 +1,19 @@
+"""
+This small example loads the cells3d dataset from scikit-image into LEVERSC for visualization
+"""
+import numpy as np
+from skimage.data import cells3d
+
+import leversc
+
+# Load the cells3d dataset
+cells = cells3d()
+# Rearrange the dimensions to be in expected order (c,z,y,x) for row-major numpy array
+cellsC = np.copy(np.transpose(cells,[1,0,2,3]), order='C')
+
+# Set up the image metadata: such as physical voxel size, and channel names
+# See: https://scikit-image.org/docs/0.18.x/api/skimage.data.html?highlight=cells3d#skimage.data.cells3d
+imD = {"PixelPhysicalSize": [0.29,0.26,0.26],
+    "ChannelNames": ["Membrane","Nuclei"]}
+# Send data to the LEVERSC viewer
+lsc = leversc.leversc(im=cellsC, imD=imD)
-- 
GitLab