extensions/xnat/src/components/XNATNavigation/XNATSession.js
/**
   * _getRoiCollectionCounts - Given a list of assessors, count the number
   * of ROI Contour collections and Segmentation collections.
   *
   * @param  {Object} assessors The JSON object containing assessor info fetched
   * from XNAT.
   * @returns {null}
   */
Given a list of assessors, count the number
of ROI Contour collections and Segmentation collections.

@param  {Object} assessors The JSON object containing assessor info fetched
from XNAT.
@returns {null}
Given a list of assessors count the number of ROI Contour collections and Segmentation collections . @param { Object } assessors The JSON object containing assessor info fetched from XNAT . @returns { null }
_getRoiCollectionCounts(assessors) {
    const promises = [];
    for (let i = 0; i < assessors.length; i++) {
      if (assessors[i].xsiType === 'icr:roiCollectionData') {
        const cancelablePromise = fetchJSON(
          `data/archive/projects/${this.props.projectId}/subjects/${this.props.subjectId}/experiments/${this.props.ID}/assessors/${assessors[i].ID}?format=json`
        );
        this._cancelablePromises.push(cancelablePromise);
        promises.push(cancelablePromise.promise);
      }
    }
    let maskCount = 0;
    let contourCount = 0;
    Promise.all(promises).then(promisesJSON => {
      promisesJSON.forEach(roiCollectionInfo => {
        const type = roiCollectionInfo.items[0].data_fields.collectionType;
        switch (type) {
          case 'RTSTRUCT':
          case 'AIM':
            contourCount++;
            break;
          case 'SEG':
          case 'NIFTI':
            maskCount++;
            break;
        }
      });
      this.setState({
        maskCount,
        contourCount,
      });
    });
  }
_getRoiCollectionCounts ( assessors ) { const promises = [ ] ; for ( let i = 0 ; i < assessors . length ; i ++ ) { if ( assessors [ i ] . xsiType === 'icr:roiCollectionData' ) { const cancelablePromise = fetchJSON ( ` ${ this . props . projectId } ${ this . props . subjectId } ${ this . props . ID } ${ assessors [ i ] . ID } ` ) ; this . _cancelablePromises . push ( cancelablePromise ) ; promises . push ( cancelablePromise . promise ) ; } } let maskCount = 0 ; let contourCount = 0 ; Promise . all ( promises ) . then ( promisesJSON => { promisesJSON . forEach ( roiCollectionInfo => { const type = roiCollectionInfo . items [ 0 ] . data_fields . collectionType ; switch ( type ) { case 'RTSTRUCT' : case 'AIM' : contourCount ++ ; break ; case 'SEG' : case 'NIFTI' : maskCount ++ ; break ; } } ) ; this . setState ( { maskCount , contourCount , } ) ; } ) ; }
_getRoiCollectionCounts - Given a list of assessors, count the number
 of ROI Contour collections and Segmentation collections.
_getRoiCollectionCounts - Given a list of assessors count the number of ROI Contour collections and Segmentation collections .