- support for tiled images

- poetry
This commit is contained in:
Wim Pomp
2024-10-10 18:18:59 +02:00
parent 8b50b0258f
commit 475054a286
5 changed files with 31 additions and 30 deletions

View File

@@ -1,6 +0,0 @@
#!/usr/bin/env python3
from tiffexplore import main
if __name__ == '__main__':
main()

27
pyproject.toml Normal file
View File

@@ -0,0 +1,27 @@
[tool.poetry]
name = "tiffexplore"
version = "2024.10.0"
description = "Explore a tiff structure."
authors = ["Wim Pomp, <wimpomp@gmail.com>"]
license = "GPL-3.0-or-later"
readme = "README.md"
packages = [{include = "tiffexplore"}]
repository = "https://github.com/wimpomp/tiffexplore"
[tool.poetry.scripts]
tiffexplore = "tiffexplore:main"
[tool.poetry.dependencies]
python = "^3.7"
tifffile = "*"
PyQt5 = "*"
[tool.pytest.ini_options]
filterwarnings = ["ignore:::(?!tiffexplore)"]
[tool.isort]
line_length = 119
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@@ -1,23 +0,0 @@
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="tiffexplore",
packages=["tiffexplore"],
version="2021.07.1",
author="Wim Pomp",
author_email="wimpomp@gmail.com",
description="Explore a tiff structure.",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.7',
install_requires=['numpy', 'tifffile', 'PyQt5'],
scripts=['bin/tiffexplore'],
)

View File

@@ -220,7 +220,7 @@ class App(QtWidgets.QMainWindow, UiMainWindow):
shape = im.shape
im = QtGui.QImage(im, im.shape[1], im.shape[0], QtGui.QImage.Format_Grayscale8)
f = min([a / b for a, b in zip((self.image.height(), self.image.width()), shape)])
pix = QtGui.QPixmap(im).scaled(f * shape[1], f * shape[0])
pix = QtGui.QPixmap(im).scaled(int(f) * shape[1], int(f) * shape[0])
else:
pix = QtGui.QPixmap()
self.image.setPixmap(pix)

View File

@@ -38,6 +38,9 @@ class tiff():
if 273 in tags and 279 in tags:
for i, a in enumerate(zip(tags[273][-1], tags[279][-1])):
self.addresses[('image', (*idx, i))] = a
elif 324 in tags and 325 in tags:
for i, a in enumerate(zip(tags[324][-1], tags[325][-1])):
self.addresses[('image', (*idx, i))] = a
for code in (330, 400, 34665, 34853, 40965):
if code in tags:
if len(tags[code][3]) == 1: