extensions/xnat/src/utils/IO/classes/RTStructReader.js
/**
   * _extractOnePolygon - Extracts one polygon from the ROIContour.
   *
   * @param  {object} contourSequenceItemData The dataset for the polygon.
   * @param  {string} ROIContourUid           The UID of the ROIContour.
   * @param  {number} ROINumber               The index of the ROIContour.
   * @returns {null}
   */
Extracts one polygon from the ROIContour.
@param  {object} contourSequenceItemData The dataset for the polygon.
@param  {string} ROIContourUid           The UID of the ROIContour.
@param  {number} ROINumber               The index of the ROIContour.
@returns {null}
Extracts one polygon from the ROIContour . @param { object } contourSequenceItemData The dataset for the polygon . @param { string } ROIContourUid The UID of the ROIContour . @param { number } ROINumber The index of the ROIContour . @returns { null }
_extractOnePolygon(contourSequenceItemData, ROIContourUid, ROINumber) {
    const contourGeometricType = contourSequenceItemData.string(
      RTStructTag['ContourGeometricType']
    );
    if (contourGeometricType !== 'CLOSED_PLANAR') {
      return;
    }
    const contourImageSequenceData =
      contourSequenceItemData.elements[RTStructTag['ContourImageSequence']]
        .items[0].dataSet;
    const referencedSopInstanceUid = contourImageSequenceData.string(
      RTStructTag['ReferencedSOPInstanceUID']
    );
    if (!this._sopInstancesInSeries.includes(referencedSopInstanceUid)) {
      return;
    }
    const referencedFrameNumber = contourImageSequenceData.string(
      RTStructTag['ReferencedFrameNumber']
    );
    const contourNumber = contourSequenceItemData.string(
      RTStructTag['ContourNumber']
    );
    const polygonUid = `${this._sopInstanceUid}.${ROINumber}.${contourNumber}`;
    const points = this._extractPoints(
      contourSequenceItemData,
      referencedSopInstanceUid
    );
    const polygon = new Polygon(
      points,
      referencedSopInstanceUid,
      this._seriesInstanceUidToImport,
      this._roiCollectionLabel,
      ROIContourUid,
      polygonUid,
      referencedFrameNumber
    );
    this._polygons.push(polygon);
  }
_extractOnePolygon ( contourSequenceItemData , ROIContourUid , ROINumber ) { const contourGeometricType = contourSequenceItemData . string ( RTStructTag [ 'ContourGeometricType' ] ) ; if ( contourGeometricType !== 'CLOSED_PLANAR' ) { return ; } const contourImageSequenceData = contourSequenceItemData . elements [ RTStructTag [ 'ContourImageSequence' ] ] . items [ 0 ] . dataSet ; const referencedSopInstanceUid = contourImageSequenceData . string ( RTStructTag [ 'ReferencedSOPInstanceUID' ] ) ; if ( ! this . _sopInstancesInSeries . includes ( referencedSopInstanceUid ) ) { return ; } const referencedFrameNumber = contourImageSequenceData . string ( RTStructTag [ 'ReferencedFrameNumber' ] ) ; const contourNumber = contourSequenceItemData . string ( RTStructTag [ 'ContourNumber' ] ) ; const polygonUid = ` ${ this . _sopInstanceUid } ${ ROINumber } ${ contourNumber } ` ; const points = this . _extractPoints ( contourSequenceItemData , referencedSopInstanceUid ) ; const polygon = new Polygon ( points , referencedSopInstanceUid , this . _seriesInstanceUidToImport , this . _roiCollectionLabel , ROIContourUid , polygonUid , referencedFrameNumber ) ; this . _polygons . push ( polygon ) ; }
_extractOnePolygon - Extracts one polygon from the ROIContour.
_extractOnePolygon - Extracts one polygon from the ROIContour .
// Only parse closed polygons // Don't extract polygon if it doesn't belong to the series being imported