Skip to content

Commit

Permalink
Merge pull request #623 from girder/band-info-frames
Browse files Browse the repository at this point in the history
Fix getting band information on frames.
  • Loading branch information
manthey authored Jul 7, 2021
2 parents 73ce429 + 8cd7783 commit ac82f8f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
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

0 comments on commit ac82f8f

Please sign in to comment.