Skip to content

Commit

Permalink
fix(ImJoyAPI): Tweak setVolumeScatteringBlend naming
Browse files Browse the repository at this point in the history
- Consistent `Image` prefix for image-related parameters
- Shorter, more consistent `Volume` over `Volumetric`
  • Loading branch information
thewtex committed Oct 5, 2022
1 parent 90220ad commit c691805
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 c691805

Please sign in to comment.