Skip to content

Commit 6b6b004

Browse files
committed
Consider THUMBNAIL images part of image pyramid
1 parent 074672a commit 6b6b004

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/channel.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ class _Channel {
580580
const imageResolutions = []
581581
const imageOrigins = []
582582
const imagePixelSpacings = []
583+
const physicalSizes = []
583584
const offset = [0, -1]
584585
const baseTotalPixelMatrixColumns = image.pyramidBaseMetadata.TotalPixelMatrixColumns
585586
const baseTotalPixelMatrixRows = image.pyramidBaseMetadata.TotalPixelMatrixRows
@@ -600,6 +601,11 @@ class _Channel {
600601
nRows
601602
])
602603
imagePixelSpacings.push(pixelSpacing)
604+
605+
physicalSizes.push([
606+
(totalPixelMatrixColumns * pixelSpacing[0]).toFixed(4),
607+
(totalPixelMatrixRows * pixelSpacing[1]).toFixed(4)
608+
])
603609
/*
604610
* Compute the resolution at each pyramid level, since the zoom
605611
* factor may not be the same between adjacent pyramid levels.
@@ -619,6 +625,16 @@ class _Channel {
619625
imageOrigins.reverse()
620626
imagePixelSpacings.reverse()
621627

628+
const uniquePhysicalSizes = [
629+
...new Set(physicalSizes.map(v => v.toString()))
630+
].map(v => v.split(','))
631+
if (uniquePhysicalSizes.length > 1) {
632+
console.warn(
633+
'images of the image pyramid have different sizes (in millimeter): ',
634+
physicalSizes
635+
)
636+
}
637+
622638
/** Frames may extend beyond the size of the total pixel matrix.
623639
* The excess pixels are empty, i.e. have only a padding value.
624640
* We set the extent to the size of the actual image without taken

src/metadata.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ function groupColorInstances (metadata) {
162162
const microscopyImage = new VLWholeSlideMicroscopyImage({
163163
metadata: metadata[i]
164164
})
165-
if (microscopyImage.ImageType[2] !== 'VOLUME') {
165+
if (
166+
microscopyImage.ImageType[2] === 'LABEL' ||
167+
microscopyImage.ImageType[2] === 'OVERVIEW'
168+
) {
166169
continue
167170
}
168171

src/viewer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,6 @@ class VolumeImageViewer {
999999
*/
10001000

10011001
const z = tileCoord[0]
1002-
console.debug('Pyramid level:', z)
10031002
const y = tileCoord[1] + 1
10041003
const x = tileCoord[2] + 1
10051004
const index = x + '-' + y

0 commit comments

Comments
 (0)