Skip to content

Commit

Permalink
Merge pull request #1367 from girder/fix-series-detection
Browse files Browse the repository at this point in the history
Only keep bioformats series that are the same dimensions.
  • Loading branch information
manthey authored Nov 9, 2023
2 parents 2d3794b + 084bb06 commit f04147d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### Bug Fixes
- Default to "None" for the DICOM assetstore limit ([#1359](../../pull/1359))
- Fix series detection for some bioformats files ([#1365](../../pull/1365))
- Fix series detection for some bioformats files ([#1365](../../pull/1365), [#1367](../../pull/1367))

## 1.26.0

Expand Down
9 changes: 6 additions & 3 deletions sources/bioformats/large_image_source_bioformats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,20 @@ def _getSeriesStarts(self, rdr): # noqa
for idx in range(1, self._metadata['seriesCount']):
rdr.setSeries(idx)
if (rdr.getSizeX() == self._metadata['sizeX'] and
rdr.getSizeY() == self._metadata['sizeY']):
rdr.getSizeY() == self._metadata['sizeY'] and
rdr.getImageCount() == self._metadata['imageCount']):
frameList.append([idx])
if nextSeriesNum == idx:
nextSeriesNum = idx + 1
lastX, lastY = self._metadata['sizeX'], self._metadata['sizeY']
if (rdr.getSizeX() * rdr.getSizeY() >
self._metadata['sizeX'] * self._metadata['sizeY']):
if (rdr.getSizeX() * rdr.getSizeY() * rdr.getImageCount() >
self._metadata['sizeX'] * self._metadata['sizeY'] *
self._metadata['imageCount']):
frameList = [[idx]]
nextSeriesNum = idx + 1
self._metadata['sizeX'] = self.sizeX = lastX = rdr.getSizeX()
self._metadata['sizeY'] = self.sizeY = lastY = rdr.getSizeY()
self._metadata['imageCount'] = rdr.getImageCount()
if (lastX and lastY and
nearPowerOfTwo(rdr.getSizeX(), lastX) and rdr.getSizeX() < lastX and
nearPowerOfTwo(rdr.getSizeY(), lastY) and rdr.getSizeY() < lastY):
Expand Down

0 comments on commit f04147d

Please sign in to comment.