Skip to content

Commit

Permalink
Merge pull request #591 from thewtex/scattering-api
Browse files Browse the repository at this point in the history
fix(ImJoyAPI): Tweak setVolumeScatteringBlend naming
  • Loading branch information
thewtex authored Oct 5, 2022
2 parents 90220ad + c691805 commit d72523d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/ImJoyPluginAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ class ImJoyPluginAPI {
return this.viewer.getCroppingPlanes()
}

setVolumetricScatteringBlend(scatteringBlend, name) {
this.viewer.setVolumetricScatteringBlend(scatteringBlend, name)
setImageVolumeScatteringBlend(scatteringBlend, name) {
this.viewer.setImageVolumeScatteringBlend(scatteringBlend, name)
}

getVolumetricScatteringBlend(name) {
return this.viewer.getVolumetricScatteringBlend(name)
getImageVolumeScatteringBlend(name) {
return this.viewer.getImageVolumeScatteringBlend(name)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/createViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ const createViewer = async (
return store.itkVtkView
}

publicAPI.setVolumetricScatteringBlend = (scatteringBlend, name) => {
publicAPI.setImageVolumeScatteringBlend = (scatteringBlend, name) => {
if (typeof name === 'undefined') {
name = context.images.selectedName
}
Expand All @@ -1189,7 +1189,7 @@ const createViewer = async (
})
}

publicAPI.getVolumetricScatteringBlend = name => {
publicAPI.getImageVolumeScatteringBlend = name => {
if (typeof name === 'undefined') {
name = context.images.selectedName
}
Expand Down
6 changes: 3 additions & 3 deletions test/createViewerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ test('Test createViewer', async t => {
viewer.setBackgroundColor(TEST_VIEWER_STYLE.backgroundColor)

const VALUE = 0.3
viewer.setVolumetricScatteringBlend(VALUE)
viewer.setImageVolumeScatteringBlend(VALUE)
t.equal(
viewer.getVolumetricScatteringBlend(),
viewer.getImageVolumeScatteringBlend(),
VALUE,
'getVolumetricScatteringBlend matches setVolumetricScatteringBlend'
'getImageVolumeScatteringBlend matches setImageVolumeScatteringBlend'
)

viewer.setUICollapsed(false)
Expand Down

0 comments on commit d72523d

Please sign in to comment.