extensions/xnat/src/utils/IO/classes/AIMReader.js
/**
   * _createNewVolumeAndGetUid - Creates a new ROIContour and returns the UID.
   *
   * @param  {HTMLElement} childElementsOfAnnotation The child elements of an AIM
   *                                          ImageAnnotation.
   * @returns {string}  The ROIContourUid of the new contour.
   */
Creates a new ROIContour and returns the UID.
@param  {HTMLElement} childElementsOfAnnotation The child elements of an AIM
ImageAnnotation.
@returns {string}  The ROIContourUid of the new contour.
Creates a new ROIContour and returns the UID . @param { HTMLElement } childElementsOfAnnotation The child elements of an AIM ImageAnnotation . @returns { string } The ROIContourUid of the new contour .
_createNewVolumeAndGetUid(childElementsOfAnnotation) {
    const freehand3DStore = this._freehand3DStore;
    let name;
    let uid;
    let comment;
    for (let i = 0; i < childElementsOfAnnotation.length; i++) {
      if (childElementsOfAnnotation[i].tagName === 'uniqueIdentifier') {
        uid = childElementsOfAnnotation[i].getAttribute('root');
      } else if (childElementsOfAnnotation[i].tagName === 'name') {
        name = childElementsOfAnnotation[i].getAttribute('value');
      } else if (childElementsOfAnnotation[i].tagName === 'comment') {
        comment = childElementsOfAnnotation[i].getAttribute('value');
      }
    }
    if (!uid) {
      throw Error('Invalid AIM, no imageAnnotation uniqueIdentifier found!');
    }
    if (!name) {
      if (comment) {
        name = comment;
      } else {
        console.log(
          'No name or comment for imageAnnotation, using default name "Untitled Lession"'
        );
        name = 'Untitled Lession';
      }
    }
    const structureSet = freehand3DStore.getters.structureSet(
      this._seriesInstanceUidToImport,
      this._roiCollectionLabel
    );
    if (!structureSet) {
      freehand3DStore.setters.structureSet(
        this._seriesInstanceUidToImport,
        this._roiCollectionName,
        {
          isLocked: true,
          visible: true,
          uid: this._roiCollectionLabel,
        }
      );
    }
    const ROIContourUid = freehand3DStore.setters.ROIContour(
      this._seriesInstanceUidToImport,
      this._roiCollectionLabel,
      name,
      {
        uid,
      }
    );
    return ROIContourUid;
  }
_createNewVolumeAndGetUid ( childElementsOfAnnotation ) { const freehand3DStore = this . _freehand3DStore ; let name ; let uid ; let comment ; for ( let i = 0 ; i < childElementsOfAnnotation . length ; i ++ ) { if ( childElementsOfAnnotation [ i ] . tagName === 'uniqueIdentifier' ) { uid = childElementsOfAnnotation [ i ] . getAttribute ( 'root' ) ; } else if ( childElementsOfAnnotation [ i ] . tagName === 'name' ) { name = childElementsOfAnnotation [ i ] . getAttribute ( 'value' ) ; } else if ( childElementsOfAnnotation [ i ] . tagName === 'comment' ) { comment = childElementsOfAnnotation [ i ] . getAttribute ( 'value' ) ; } } if ( ! uid ) { throw Error ( 'Invalid AIM, no imageAnnotation uniqueIdentifier found!' ) ; } if ( ! name ) { if ( comment ) { name = comment ; } else { console . log ( 'No name or comment for imageAnnotation, using default name "Untitled Lession"' ) ; name = 'Untitled Lession' ; } } const structureSet = freehand3DStore . getters . structureSet ( this . _seriesInstanceUidToImport , this . _roiCollectionLabel ) ; if ( ! structureSet ) { freehand3DStore . setters . structureSet ( this . _seriesInstanceUidToImport , this . _roiCollectionName , { isLocked : true , visible : true , uid : this . _roiCollectionLabel , } ) ; } const ROIContourUid = freehand3DStore . setters . ROIContour ( this . _seriesInstanceUidToImport , this . _roiCollectionLabel , name , { uid , } ) ; return ROIContourUid ; }
_createNewVolumeAndGetUid - Creates a new ROIContour and returns the UID.
_createNewVolumeAndGetUid - Creates a new ROIContour and returns the UID .