code: function getImageIdSpecificToolState(element, toolType) {
      const enabledElement = external.cornerstone.getEnabledElement(element);
      // If we don't have any tool state for this imageId, return undefined
  
      if (
        !enabledElement.image ||
        toolState.hasOwnProperty(enabledElement.image.imageId) === false
      ) {
        return;
      }
  
      const imageIdToolState = toolState[enabledElement.image.imageId];
  
      // If we don't have tool state for this type of tool, return undefined
      if (imageIdToolState.hasOwnProperty(toolType) === false) {
        return;
      }
  
      const toolData = imageIdToolState[toolType];
  
      return toolData;
    }
docs: Here you can get state - used by tools as well as modules That save state persistently