function addImageIdSpecificToolState(element, toolType, data) {
    var enabledImage = _externalModules2.default.cornerstone.getEnabledElement(element);
    // If we don't have any tool state for this imageId, add an empty object

    if (!enabledImage.image || toolState.hasOwnProperty(enabledImage.image.imageId) === false) {
      toolState[enabledImage.image.imageId] = {};
    }

    var imageIdToolState = toolState[enabledImage.image.imageId];

    // If we don't have tool state for this type of tool, add an empty object
    if (imageIdToolState.hasOwnProperty(toolType) === false) {
      imageIdToolState[toolType] = {
        data: []
      };
    }

    var toolData = imageIdToolState[toolType];

    // Finally, add this new tool to the state
    toolData.data.push(data);
  }
// As modules that restore saved state
As modules that restore saved state
As modules that restore saved state
function addImageIdSpecificToolState(element, toolType, data) {
    var enabledImage = _externalModules2.default.cornerstone.getEnabledElement(element);
    if (!enabledImage.image || toolState.hasOwnProperty(enabledImage.image.imageId) === false) {
      toolState[enabledImage.image.imageId] = {};
    }
    var imageIdToolState = toolState[enabledImage.image.imageId];
    if (imageIdToolState.hasOwnProperty(toolType) === false) {
      imageIdToolState[toolType] = {
        data: []
      };
    }
    var toolData = imageIdToolState[toolType];
    toolData.data.push(data);
  }
function addImageIdSpecificToolState ( element , toolType , data ) { var enabledImage = _externalModules2 . default . cornerstone . getEnabledElement ( element ) ; if ( ! enabledImage . image || toolState . hasOwnProperty ( enabledImage . image . imageId ) === false ) { toolState [ enabledImage . image . imageId ] = { } ; } var imageIdToolState = toolState [ enabledImage . image . imageId ] ; if ( imageIdToolState . hasOwnProperty ( toolType ) === false ) { imageIdToolState [ toolType ] = { data : [ ] } ; } var toolData = imageIdToolState [ toolType ] ; toolData . data . push ( data ) ; }
As modules that restore saved state
As modules that restore saved state
// If we don't have any tool state for this imageId, add an empty object // If we don't have tool state for this type of tool, add an empty object // Finally, add this new tool to the state