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 getting band information on frames. #623

Merged
merged 1 commit into from
Jul 7, 2021
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Unreleased

### Features
- Provide band information on all tile sources (#622)
- Provide band information on all tile sources (#622, #623)

## Version 1.6.2

Expand Down
2 changes: 1 addition & 1 deletion girder/girder_large_image/models/image_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def getBandInformation(self, item, statistics=True, **kwargs):
:returns: band information.
"""
tileSource = self._loadTileSource(item, **kwargs)
result = tileSource.getBandInformation(statistics=statistics)
result = tileSource.getBandInformation(statistics=statistics, **kwargs)
return result

def tileSource(self, item, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion girder/girder_large_image/rest/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def getBandInformation(self, item, params):
('frame', int),
])
_handleETag('getBandInformation', item, params)
result = self.imageItemModel.getBandInformation(item)
result = self.imageItemModel.getBandInformation(item, **params)
return result

@describeRoute(
Expand Down
13 changes: 13 additions & 0 deletions girder/test_girder/test_tiles_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,19 @@ def testTilesBandInformation(server, admin, fsAssetstore):
assert 'mean' in resp.json[0]


@pytest.mark.usefixtures('unbindLargeImage')
@pytest.mark.plugin('large_image')
def testTilesBandInformationWithFrames(server, admin, fsAssetstore):
file = utilities.uploadExternalFile(
'sample.ome.tif', admin, fsAssetstore)
itemId = str(file['itemId'])
resp = server.request(path='/item/%s/tiles/bands' % itemId)
assert len(resp.json) == 1
resp2 = server.request(path='/item/%s/tiles/bands' % itemId, params={'frame': 1})
assert len(resp2.json) == 1
assert resp != resp2


@pytest.mark.usefixtures('unbindLargeImage')
@pytest.mark.plugin('large_image')
def testTilesFromMultipleDotName(boundServer, admin, fsAssetstore, girderWorker):
Expand Down