From ad9e8f2c2ae96b3fa04a473d640bca05b372ed70 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Fri, 1 Dec 2017 11:47:36 -0500 Subject: [PATCH] Added tiff preprocessor for REV data --- example/CMakeLists.txt | 1 + example/Tiff/TiffPreprocessor.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 example/Tiff/TiffPreprocessor.py diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index b587204d..26cca233 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -11,6 +11,7 @@ INSTALL_EXAMPLE( relperm ) INSTALL_EXAMPLE( Poiseuille ) INSTALL_EXAMPLE( Juanes ) INSTALL_EXAMPLE( MicroModel ) +INSTALL_EXAMPLE( Tiff ) # Create unit tests for each example diff --git a/example/Tiff/TiffPreprocessor.py b/example/Tiff/TiffPreprocessor.py new file mode 100644 index 00000000..f31e6b35 --- /dev/null +++ b/example/Tiff/TiffPreprocessor.py @@ -0,0 +1,20 @@ +from skimage import io +import glob +import numpy as np + +print("Concatenating tiff files into 3D volume") + +IMAGES=sorted(glob.glob("*.tif")) +data=np.array([]) + +mydata=[] +for im in IMAGES: + print(im) + image=io.imread(im) + mydata.append(image) +# data=np.append(data,image,2) + +data=np.array(mydata) +data.tofile("data.raw") + +