extensions/xnat/src/utils/IO/classes/RoiImporter.js
/**
   * _addImageToolStateIfNotPresent - Adds freehand toolState to imageId if its not present.
   *
   * @param  {object} toolStateManager The toolStateManager object.
   * @param  {string} imageId          The imageId of the Cornerstone image.
   * @returns {null}
   */
Adds freehand toolState to imageId if its not present.
Adds freehand toolState to imageId if its not present .
_addImageToolStateIfNotPresent(toolStateManager, imageId) {
    if (!toolStateManager[imageId]) {
      toolStateManager[imageId] = {};
      toolStateManager[imageId][FREEHAND_ROI_3D_TOOL] = {};
      toolStateManager[imageId][FREEHAND_ROI_3D_TOOL].data = [];
    } else if (!toolStateManager[imageId][FREEHAND_ROI_3D_TOOL]) {
      toolStateManager[imageId][FREEHAND_ROI_3D_TOOL] = {};
      toolStateManager[imageId][FREEHAND_ROI_3D_TOOL].data = [];
    }
  }
_addImageToolStateIfNotPresent ( toolStateManager , imageId ) { if ( ! toolStateManager [ imageId ] ) { toolStateManager [ imageId ] = { } ; toolStateManager [ imageId ] [ FREEHAND_ROI_3D_TOOL ] = { } ; toolStateManager [ imageId ] [ FREEHAND_ROI_3D_TOOL ] . data = [ ] ; } else if ( ! toolStateManager [ imageId ] [ FREEHAND_ROI_3D_TOOL ] ) { toolStateManager [ imageId ] [ FREEHAND_ROI_3D_TOOL ] = { } ; toolStateManager [ imageId ] [ FREEHAND_ROI_3D_TOOL ] . data = [ ] ; } }
_addImageToolStateIfNotPresent - Adds freehand toolState to imageId if its not present.
_addImageToolStateIfNotPresent - Adds freehand toolState to imageId if its not present .
// Add freehand tools to toolStateManager if no toolState for imageId