src/VTKViewport/Manipulators/customWindowLevel.js
/**
 * Adjust the window level based on the mouse movement.
 */
Adjust the window level based on the mouse movement.
Adjust the window level based on the mouse movement .
function onMove(publicAPI, model, callData) {
  const pos = [callData.position.x, callData.position.y];
  publicAPI.windowLevelFromMouse(pos);
  const { apis, apiIndex } = model;
  if (apis && apis[apiIndex] && apis[apiIndex].type === 'VIEW2D') {
    apis.forEach((api, viewportIndex) => {
      const renderWindow = api.genericRenderWindow.getRenderWindow();
      renderWindow.render();
    });
  }
  if (model.onWindowLevelsChanged) {
    model.onWindowLevelsChanged();
  }
}
function onMove ( publicAPI , model , callData ) { const pos = [ callData . position . x , callData . position . y ] ; publicAPI . windowLevelFromMouse ( pos ) ; const { apis , apiIndex } = model ; if ( apis && apis [ apiIndex ] && apis [ apiIndex ] . type === 'VIEW2D' ) { apis . forEach ( ( api , viewportIndex ) => { const renderWindow = api . genericRenderWindow . getRenderWindow ( ) ; renderWindow . render ( ) ; } ) ; } if ( model . onWindowLevelsChanged ) { model . onWindowLevelsChanged ( ) ; } }
Adjust the window level based on the mouse movement.
Adjust the window level based on the mouse movement .
// Force each view to redraw. // Fire the onChange callback.