Skip to content

Commit

Permalink
fix(applyRenderedImage): Avoid call setSeCornerAnnotation when not
Browse files Browse the repository at this point in the history
available

Proxy setup issues to workaround the function not being defined until we no
longer use the proxy.
  • Loading branch information
thewtex committed Nov 16, 2022
1 parent c37a325 commit 6865723
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Rendering/VTKJS/Images/applyRenderedImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,14 @@ function applyRenderedImage(context, { data: { name } }) {

const loadedImage = actorContext.image ?? actorContext.labelImage
const hasOneScale = loadedImage.scaleInfo.length === 1
if (hasOneScale) {
context.itkVtkView.setSeCornerAnnotation(ANNOTATION_DEFAULT)
} else {
context.itkVtkView.setSeCornerAnnotation(
`${ANNOTATION_CUSTOM_PREFIX}<td style="margin-left: 0; margin-right: auto;">${actorContext.loadedScale}</td>${ANNOTATION_CUSTOM_POSTFIX}`
)
if (context.itkVtkView.setSeCornerAnnotation) {
if (hasOneScale) {
context.itkVtkView.setSeCornerAnnotation(ANNOTATION_DEFAULT)
} else {
context.itkVtkView.setSeCornerAnnotation(
`${ANNOTATION_CUSTOM_PREFIX}<td style="margin-left: 0; margin-right: auto;">${actorContext.loadedScale}</td>${ANNOTATION_CUSTOM_POSTFIX}`
)
}
}
}

Expand Down

0 comments on commit 6865723

Please sign in to comment.