Skip to content

Commit

Permalink
Merge pull request #19 from DaniGodin/master
Browse files Browse the repository at this point in the history
Update 1.7.2
  • Loading branch information
DaniGodin authored Oct 21, 2020
2 parents 7c93250 + 110d7e3 commit 28f9d5d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
24 changes: 23 additions & 1 deletion apeer_ometiff_library/io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tifffile
import numpy as np
from apeer_ometiff_library import omexmlClass
from apeer_ometiff_library import omexmlClass


def read_ometiff(input_path):
Expand All @@ -27,6 +27,28 @@ def read_ometiff(input_path):
if size_t == 1:
array = np.expand_dims(array, axis=-5)

# Makes sure to return the array in (T, Z, C, X, Y) order

dim_format = pixels.DimensionOrder

if dim_format == "XYCZT":
pass
elif dim_format == "XYZCT":
array = np.moveaxis(array, 1, 2)
elif dim_format == "XYCTZ":
array = np.moveaxis(array, 0, 1)
elif dim_format == "XYZTC":
array = np.moveaxis(array, 0, 2)
elif dim_format == "XYTZC":
array = np.moveaxis(array, 0, 2)
array = np.moveaxis(array, 0, 1)
elif dim_format == "XYTCZ":
array = np.moveaxis(array, 1, 2)
array = np.moveaxis(array, 0, 1)
else:
print(array.shape)
raise Exception("Unknow dimension format")

return array, omexml_string

def update_xml(omexml, Image_ID=None, Image_Name=None, Image_AcquisitionDate=None,
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
numpy==1.16.5
xmltodict==0.12.0
tifffile==2020.2.16
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from setuptools import setup

setup(name='apeer-ometiff-library',
version='1.7.1',
version='1.7.2',
description='Library to read and write ometiff images',
url='https://github.com/apeer-micro/apeer-ometiff-library',
author='apeer-micro',
packages=setuptools.find_packages(),
install_requires=['numpy', 'scikit-image'],
install_requires=['numpy','tifffile'],
license='MIT',
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 28f9d5d

Please sign in to comment.