Skip to content

Commit 45e0d93

Browse files
committed
ENH: Update to itk-vtk-viewer 10.0.0
1 parent cf486f1 commit 45e0d93

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

js/lib/lineProfiler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ const LineProfilerView = viewer.ViewerView.extend({
111111
}
112112
const debouncedOnInteractionEvent = macro.debounce(onInteractionEvent, 200);
113113
lineWidget.onInteractionEvent(debouncedOnInteractionEvent)
114-
this.model.itkVtkViewer.subscribeViewModeChanged(debouncedOnInteractionEvent)
115-
this.model.itkVtkViewer.subscribeXSliceChanged(debouncedOnInteractionEvent)
116-
this.model.itkVtkViewer.subscribeYSliceChanged(debouncedOnInteractionEvent)
117-
this.model.itkVtkViewer.subscribeZSliceChanged(debouncedOnInteractionEvent)
114+
this.model.itkVtkViewer.on('viewModeChanged', debouncedOnInteractionEvent)
115+
this.model.itkVtkViewer.on('xSliceChanged', debouncedOnInteractionEvent)
116+
this.model.itkVtkViewer.on('ySliceChanged', debouncedOnInteractionEvent)
117+
this.model.itkVtkViewer.on('zSliceChanged', debouncedOnInteractionEvent)
118118
},
119119

120120
point1_changed: function() {

js/lib/viewer.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
724724
this.model.save_changes()
725725
}
726726
}
727-
this.model.itkVtkViewer.subscribeToggleUserInterfaceCollapsed(
727+
this.model.itkVtkViewer.on('toggleUserInterfaceCollapsed',
728728
onUserInterfaceCollapsedToggle
729729
)
730730

@@ -734,23 +734,23 @@ const ViewerView = widgets.DOMWidgetView.extend({
734734
this.model.save_changes()
735735
}
736736
}
737-
this.model.itkVtkViewer.subscribeToggleRotate(onRotateToggle)
737+
this.model.itkVtkViewer.on('toggleRotate', onRotateToggle)
738738

739739
const onAnnotationsToggle = (enabled) => {
740740
if (enabled !== this.model.get('annotations')) {
741741
this.model.set('annotations', enabled)
742742
this.model.save_changes()
743743
}
744744
}
745-
this.model.itkVtkViewer.subscribeToggleAnnotations(onAnnotationsToggle)
745+
this.model.itkVtkViewer.on('toggleAnnotations', onAnnotationsToggle)
746746

747747
const onInterpolationToggle = (enabled) => {
748748
if (enabled !== this.model.get('interpolation')) {
749749
this.model.set('interpolation', enabled)
750750
this.model.save_changes()
751751
}
752752
}
753-
this.model.itkVtkViewer.subscribeToggleInterpolation(onInterpolationToggle)
753+
this.model.itkVtkViewer.on('toggleInterpolation', onInterpolationToggle)
754754

755755
const onSelectColorMap = (component, colorMap) => {
756756
if (
@@ -761,7 +761,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
761761
this.model.save_changes()
762762
}
763763
}
764-
this.model.itkVtkViewer.subscribeSelectColorMap(onSelectColorMap)
764+
this.model.itkVtkViewer.on('selectColorMap', onSelectColorMap)
765765

766766
const onChangeColorRange = (component, colorRange) => {
767767
const vmin = this.model.get('vmin')
@@ -775,7 +775,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
775775
this.model.save_changes()
776776
}
777777
}
778-
this.model.itkVtkViewer.subscribeChangeColorRange(onChangeColorRange)
778+
this.model.itkVtkViewer.on('changeColorRange', onChangeColorRange)
779779

780780
const onCroppingPlanesChanged = (planes, bboxCorners) => {
781781
if (
@@ -799,23 +799,23 @@ const ViewerView = widgets.DOMWidgetView.extend({
799799
this.model.skipOnCroppingPlanesChanged = false
800800
}
801801
}
802-
this.model.itkVtkViewer.subscribeCroppingPlanesChanged(
802+
this.model.itkVtkViewer.on('croppingPlanesChanged',
803803
onCroppingPlanesChanged
804804
)
805805

806806
const onResetCrop = () => {
807807
this.model.set('_reset_crop_requested', true)
808808
this.model.save_changes()
809809
}
810-
this.model.itkVtkViewer.subscribeResetCrop(onResetCrop)
810+
this.model.itkVtkViewer.on('resetCrop', onResetCrop)
811811

812812
const onToggleCroppingPlanes = (enabled) => {
813813
if (enabled !== this.model.get('select_roi')) {
814814
this.model.set('select_roi', enabled)
815815
this.model.save_changes()
816816
}
817817
}
818-
this.model.itkVtkViewer.subscribeToggleCroppingPlanes(
818+
this.model.itkVtkViewer.on('toggleCroppingPlanes',
819819
onToggleCroppingPlanes
820820
)
821821

@@ -843,7 +843,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
843843
this.model.save_changes()
844844
}
845845
}
846-
this.model.itkVtkViewer.subscribeBlendModeChanged(onBlendModeChanged)
846+
this.model.itkVtkViewer.on('blendModeChanged', onBlendModeChanged)
847847

848848
const onViewModeChanged = (mode) => {
849849
let pythonMode = null
@@ -868,23 +868,23 @@ const ViewerView = widgets.DOMWidgetView.extend({
868868
this.model.save_changes()
869869
}
870870
}
871-
this.model.itkVtkViewer.subscribeViewModeChanged(onViewModeChanged)
871+
this.model.itkVtkViewer.on('viewModeChanged', onViewModeChanged)
872872

873873
const onShadowToggle = (enabled) => {
874874
if (enabled !== this.model.get('shadow')) {
875875
this.model.set('shadow', enabled)
876876
this.model.save_changes()
877877
}
878878
}
879-
this.model.itkVtkViewer.subscribeToggleShadow(onShadowToggle)
879+
this.model.itkVtkViewer.on('toggleShadow', onShadowToggle)
880880

881881
const onSlicingPlanesToggle = (enabled) => {
882882
if (enabled !== this.model.get('slicing_planes')) {
883883
this.model.set('slicing_planes', enabled)
884884
this.model.save_changes()
885885
}
886886
}
887-
this.model.itkVtkViewer.subscribeToggleSlicingPlanes(
887+
this.model.itkVtkViewer.on('toggleSlicingPlanes',
888888
onSlicingPlanesToggle
889889
)
890890

@@ -894,7 +894,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
894894
this.model.save_changes()
895895
}
896896
}
897-
this.model.itkVtkViewer.subscribeXSliceChanged(onXSliceChanged)
897+
this.model.itkVtkViewer.on('xSliceChanged', onXSliceChanged)
898898
if (this.model.get('x_slice') === null) {
899899
this.model.set('x_slice', this.model.itkVtkViewer.getXSlice())
900900
this.model.save_changes()
@@ -905,7 +905,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
905905
this.model.save_changes()
906906
}
907907
}
908-
this.model.itkVtkViewer.subscribeYSliceChanged(onYSliceChanged)
908+
this.model.itkVtkViewer.on('ySliceChanged', onYSliceChanged)
909909
if (this.model.get('y_slice') === null) {
910910
this.model.set('y_slice', this.model.itkVtkViewer.getYSlice())
911911
this.model.save_changes()
@@ -916,7 +916,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
916916
this.model.save_changes()
917917
}
918918
}
919-
this.model.itkVtkViewer.subscribeZSliceChanged(onZSliceChanged)
919+
this.model.itkVtkViewer.on('zSliceChanged', onZSliceChanged)
920920
if (this.model.get('z_slice') === null) {
921921
this.model.set('z_slice', this.model.itkVtkViewer.getZSlice())
922922
this.model.save_changes()
@@ -928,7 +928,7 @@ const ViewerView = widgets.DOMWidgetView.extend({
928928
this.model.save_changes()
929929
}
930930
}
931-
this.model.itkVtkViewer.subscribeGradientOpacityChanged(
931+
this.model.itkVtkViewer.on('gradientOpacityChanged',
932932
onGradientOpacityChange
933933
)
934934
} // end use2D

js/package-lock.json

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"copy-webpack-plugin": "^5.1.1",
6464
"css-element-queries": "^1.2.3",
6565
"itk": "^13.1.0",
66-
"itk-vtk-viewer": "^9.25.0",
66+
"itk-vtk-viewer": "^10.0.0",
6767
"jupyter-dataserializers": "^2.2.0",
6868
"mobx": "^5.15.4",
6969
"regenerator-runtime": "^0.13.5",

0 commit comments

Comments
 (0)