Skip to content

displaying images (series) with different sizes causes the image to be clipped #304

@Zaid-Safadi

Description

@Zaid-Safadi

When a series with different image's size is displayed in cornerstone (stack scroll behavior), the subsequent images might get clipped (if the first image is smaller).

For example, if a series with 3 images (128x128, 256x256, 512x512) is used to render images using cornerstone.displayImage (stack scroll) the 2nd and 3rd images will be clipped to 128x128.

The reason for this is when setting the first image, the displayedArea which is part of the viewport is initialized with the same image size:

displayedArea: {
tlhc: {
x: 1,
y: 1
},
brhc: {
x: image.columns,
y: image.rows
},

Subsequent calls to displayImage will use the original viewport and merge any new properties:

// Merge viewport
if (viewport) {
for (const attrname in viewport) {
if (viewport[attrname] !== null) {
enabledElement.viewport[attrname] = viewport[attrname];
}
}
}

Workaround
The user provide a viewport parameter in the displayImage method what includes the new image displayedArea initialized

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions