function closeToolIfDrawing(element) {
  var config = freehand.getConfiguration();
  if (config.currentTool >= 0) {
    // Actively drawing but changed mode.
    var lastHandlePlaced = config.currentHandle;
    var enabledElement = _externalModules2.default.cornerstone.getEnabledElement(element);

    endDrawing({
      element: element,
      image: enabledElement.image
    }, lastHandlePlaced);
  }
}
/**
 * closeToolIfDrawing - Closes the ROI if the tool is not yet
 * complete when changing tool mode.
 *
 * @param  {Object} element The element the ROI is associated with.
 */
Closes the ROI if the tool is not yet
complete when changing tool mode.

@param  {Object} element The element the ROI is associated with.
Closes the ROI if the tool is not yet complete when changing tool mode . @param { Object } element The element the ROI is associated with .
function closeToolIfDrawing(element) {
  var config = freehand.getConfiguration();
  if (config.currentTool >= 0) {
    var lastHandlePlaced = config.currentHandle;
    var enabledElement = _externalModules2.default.cornerstone.getEnabledElement(element);
    endDrawing({
      element: element,
      image: enabledElement.image
    }, lastHandlePlaced);
  }
}
function closeToolIfDrawing ( element ) { var config = freehand . getConfiguration ( ) ; if ( config . currentTool >= 0 ) { var lastHandlePlaced = config . currentHandle ; var enabledElement = _externalModules2 . default . cornerstone . getEnabledElement ( element ) ; endDrawing ( { element : element , image : enabledElement . image } , lastHandlePlaced ) ; } }
closeToolIfDrawing - Closes the ROI if the tool is not yet
 complete when changing tool mode.
closeToolIfDrawing - Closes the ROI if the tool is not yet complete when changing tool mode .
// Actively drawing but changed mode.