diff --git a/CHANGELOG.md b/CHANGELOG.md index 509437983..19fda85f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/girder/girder_large_image/models/image_item.py b/girder/girder_large_image/models/image_item.py index 61a5d1478..8c2aa1f94 100644 --- a/girder/girder_large_image/models/image_item.py +++ b/girder/girder_large_image/models/image_item.py @@ -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): diff --git a/girder/girder_large_image/rest/tiles.py b/girder/girder_large_image/rest/tiles.py index 08c07d378..f3b6bc3f1 100644 --- a/girder/girder_large_image/rest/tiles.py +++ b/girder/girder_large_image/rest/tiles.py @@ -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( diff --git a/girder/test_girder/test_tiles_rest.py b/girder/test_girder/test_tiles_rest.py index 671e51b7f..f0d642854 100644 --- a/girder/test_girder/test_tiles_rest.py +++ b/girder/test_girder/test_tiles_rest.py @@ -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):