See the incrementAxial()
, incrementCoronal()
, and incrementSagittal()
functions in viewer.js:
papaya.viewer.Viewer.prototype.incrementAxial
papaya.viewer.Viewer.prototype.incrementCoronal
papaya.viewer.Viewer.prototype.incrementSagittal
They take one argument, a boolean to indicate whether to increment (true) or decrement (false).
In order to know which one to increment, you need to know which slice direction is the main slice. See below for an example of how that it is handled:
if (this.mainImage.sliceDirection === papaya.viewer.ScreenSlice.DIRECTION_AXIAL) {
this.incrementAxial(false);
} else if (this.mainImage.sliceDirection === papaya.viewer.ScreenSlice.DIRECTION_CORONAL) {
this.incrementCoronal(false);
} else if (this.mainImage.sliceDirection === papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL) {
this.incrementSagittal(true);
}