Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with apply a frame style to ome tiffs #1374

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Default to "None" for the DICOM assetstore limit ([#1359](../../pull/1359))
- Fix series detection for some bioformats files ([#1365](../../pull/1365), [#1367](../../pull/1367))
- Fix time comparison in annotation history check ([#1369](../../pull/1369))
- Fix an issue with apply a frame style to ome tiffs ([#1374](../../pull/1374))

## 1.26.0

Expand Down
5 changes: 3 additions & 2 deletions sources/ometiff/large_image_source_ometiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ def getNativeMagnification(self):
@methodcache()
def getTile(self, x, y, z, pilImageAllowed=False, numpyAllowed=False,
sparseFallback=False, **kwargs):
if (z < 0 or z >= len(self._omeLevels) or (
self._omeLevels[z] is not None and kwargs.get('frame') in (None, 0, '0', ''))):
if ((z < 0 or z >= len(self._omeLevels) or (
self._omeLevels[z] is not None and kwargs.get('frame') in (None, 0, '0', ''))) and
not getattr(self, '_style', None)):
return super().getTile(
x, y, z, pilImageAllowed=pilImageAllowed,
numpyAllowed=numpyAllowed, sparseFallback=sparseFallback,
Expand Down
4 changes: 3 additions & 1 deletion test/test_source_ometiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,6 @@ def testXMLParsing():
def testFrameStyleOMETiff():
imagePath = datastore.fetch('DDX58_AXL_EGFR_well2_XY01.ome.tif')
source = large_image_source_ometiff.open(imagePath, style={'bands': [{'frame': 4}]})
assert source.getTile(0, 0, 2)
tile1 = source.getTile(0, 0, 2)
tile2 = source.getTile(0, 0, 2, frame=1)
assert tile1 == tile2
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ exclude =
ignore = D100,D101,D102,D103,D104,D105,D106,D107,D200,D205,D400,D401,E741,W504,B017

[pytest]
addopts = --verbose --strict-markers --showlocals --cov-report="term" --cov-report="xml" --cov-report="html" --cov --ignore test/utils --cov-context=test
addopts = --verbose --strict-markers --showlocals --cov-report="term" --cov-report="xml" --cov-report="html" --cov --ignore test/utils
# --cov-context=test
cache_dir = build/pytest_cache
testpaths =
test
Expand Down Expand Up @@ -322,7 +323,7 @@ parallel = True
[coverage:html]
directory = build/test/artifacts/python_coverage
title = Large image Coverage Report
show_contexts = True
# show_contexts = True

[coverage:xml]
output = build/test/coverage/py_coverage.xml