src/models/models.frame.js
/**
   * Calculate the difference of instances of this frame and provided one.
   *
   * @param {ModelsFrame} frame
   *
   * @return {Number|null} Difference of instanceNumbers or sopInstanceUIDs.
   *                       0 - frames belong to the same instance.
   *                       Null - calculation is impossible.
   */
Calculate the difference of instances of this frame and provided one.

@return {Number|null} Difference of instanceNumbers or sopInstanceUIDs.
0 - frames belong to the same instance.
Null - calculation is impossible.
Calculate the difference of instances of this frame and provided one . @return { Number|null } Difference of instanceNumbers or sopInstanceUIDs . 0 - frames belong to the same instance . Null - calculation is impossible .
instanceDifference(frame) {
    if (this.instanceNumber !== null && frame.instanceNumber !== null &&
      this.instanceNumber !== frame.instanceNumber
    ) {
      return this.instanceNumber - frame.instanceNumber;
    }
    if (this.sopInstanceUID !== null && frame.sopInstanceUID !== null &&
      this.sopInstanceUID !== frame.sopInstanceUID
    ) {
      return this.sopInstanceUID - frame.sopInstanceUID;
    }
    if (this.instanceNumber === frame.instanceNumber &&
      this.sopInstanceUID === frame.sopInstanceUID
    ) {
      return 0;
    }
    return null;
  }
instanceDifference ( frame ) { if ( this . instanceNumber !== null && frame . instanceNumber !== null && this . instanceNumber !== frame . instanceNumber ) { return this . instanceNumber - frame . instanceNumber ; } if ( this . sopInstanceUID !== null && frame . sopInstanceUID !== null && this . sopInstanceUID !== frame . sopInstanceUID ) { return this . sopInstanceUID - frame . sopInstanceUID ; } if ( this . instanceNumber === frame . instanceNumber && this . sopInstanceUID === frame . sopInstanceUID ) { return 0 ; } return null ; }
Calculate the difference of instances of this frame and provided one.
Calculate the difference of instances of this frame and provided one .