src/VTKViewport/Manipulators/customWindowLevel.js
/**
 * Start the window level operation.
 */
Start the window level operation.
Start the window level operation .
function onStart(publicAPI, model, callData) {
  model.interactionOperation = InteractionOperations.WINDOW_LEVEL;
  model.wlStartPos[0] = callData.position.x;
  model.wlStartPos[1] = callData.position.y;
  if (model.volumeActor) {
    const property = model.volumeActor.getProperty();
    if (property) {
      model.initialMRange = property
        .getRGBTransferFunction(0)
        .getMappingRange()
        .slice();
      model.levels = toWindowLevel(
        model.initialMRange[0],
        model.initialMRange[1]
      );
      publicAPI.startWindowLevel();
    }
  }
  if (model.onWindowLevelsChanged) {
    model.onWindowLevelsChanged();
  }
}
function onStart ( publicAPI , model , callData ) { model . interactionOperation = InteractionOperations . WINDOW_LEVEL ; model . wlStartPos [ 0 ] = callData . position . x ; model . wlStartPos [ 1 ] = callData . position . y ; if ( model . volumeActor ) { const property = model . volumeActor . getProperty ( ) ; if ( property ) { model . initialMRange = property . getRGBTransferFunction ( 0 ) . getMappingRange ( ) . slice ( ) ; model . levels = toWindowLevel ( model . initialMRange [ 0 ] , model . initialMRange [ 1 ] ) ; publicAPI . startWindowLevel ( ) ; } } if ( model . onWindowLevelsChanged ) { model . onWindowLevelsChanged ( ) ; } }
Start the window level operation.
Start the window level operation .
// Fire the onChange callback.