Skip to content

Commit

Permalink
Merge pull request #664 from PaulHax/compare-naming
Browse files Browse the repository at this point in the history
Compare naming
  • Loading branch information
thewtex authored Mar 27, 2023
2 parents 0fdc16a + e2b2471 commit dbce270
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/compare-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

const fixedImage = new URL(
// 'test-data/HeadMRVolume.nrrd',
// 'test-data/HeadMRVolumeLabels.nrrd',
'test-data/HeadMRVolumeLabels.nrrd',
// 'test-data/HeadMRVolumeLabelsSmaller.nrrd',
'test-data/HeadMRVolume2Components.nrrd',
// 'test-data/HeadMRVolume2Components.nrrd',
window.location.origin
)

Expand Down
2 changes: 1 addition & 1 deletion src/ImJoyPluginAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class ImJoyPluginAPI {
return this.viewer.getMaxConcurrency()
}

setCompareImages(fixedImageName, movingImageName, options) {
compareImages(fixedImageName, movingImageName, options) {
return this.viewer.setCompareImages(
fixedImageName,
movingImageName,
Expand Down
6 changes: 4 additions & 2 deletions src/Rendering/Images/createImageRenderingActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ const dirtyColorRanges = (c, { data: { name } }) => {

const cleanColorRanges = (c, { data: { name } }) => {
const actorContext = c.images.actorContext.get(name)
actorContext.colorRanges = new Map()
actorContext.dirtyColorRanges = false
if (actorContext.dirtyColorRanges) {
actorContext.colorRanges = new Map()
actorContext.dirtyColorRanges = false
}
}

const assignUpdateRenderedName = assign({
Expand Down
6 changes: 0 additions & 6 deletions src/Rendering/VTKJS/Images/applyRenderedImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ function applyRenderedImage(context, { data: { name } }) {
context.images.colorTransferFunctions.get(component) ??
vtkColorTransferFunction.newInstance()

if (actorContext.colorRanges.has(component)) {
const range = actorContext.colorRanges.get(component)
colorTransferFunction.setMappingRange(range[0], range[1])
colorTransferFunction.updateRange()
}

context.images.colorTransferFunctions.set(component, colorTransferFunction)

if (!context.images.piecewiseFunctions.has(component)) {
Expand Down

0 comments on commit dbce270

Please sign in to comment.