function _getRotation (metadata) {
  // Angle with respect to the reference orientation
  const angle = computeRotation({
    orientation: metadata.ImageOrientationSlide
  })
  // We want the slide oriented horizontally with the label on the right side
  const correction = 90 * (Math.PI / 180)
  return angle + correction
}
/** Determines whether image needs to be rotated relative to slide
 * coordinate system based on direction cosines.
 * We want to rotate all images such that the X axis of the slide coordinate
 * system is the vertical axis (ordinate) of the viewport and the Y axis
 * of the slide coordinate system is the horizontal axis (abscissa) of the
 * viewport. Note that this is opposite to the Openlayers coordinate system.
 * There are only planar rotations, since the total pixel matrix is
 * parallel to the slide surface. Here, we further assume that rows and
 * columns of total pixel matrix are parallel to the borders of the slide,
 * i.e. the x and y axis of the slide coordinate system.
 *
 * The row direction (left to right) of the Total Pixel Matrix
 * is defined by the first three values.
 * The three values specify how the direction changes from the last pixel
 * to the first pixel in the row along each of the three axes of the
 * slide coordinate system (x, y, z), i.e. it express in which direction one
 * is moving in the slide coordinate system when the COLUMN index changes.
 * The column direction (top to bottom) of the Total Pixel Matrix
 * is defined by the second three values.
 * The three values specify how the direction changes from the last pixel
 * to the first pixel in the column along each of the three axes of the
 * slide coordinate system (x, y, z), i.e. it express in which direction one
 * is moving in the slide coordinate system when the ROW index changes.
 *
 * @param {object} metadata - Metadata of a DICOM VL Whole Slide Microscopy Image instance
 * @returns {number} Rotation in radians
 * @private
 */
Determines whether image needs to be rotated relative to slide
coordinate system based on direction cosines.
We want to rotate all images such that the X axis of the slide coordinate
system is the vertical axis (ordinate) of the viewport and the Y axis
of the slide coordinate system is the horizontal axis (abscissa) of the
viewport. Note that this is opposite to the Openlayers coordinate system.
There are only planar rotations, since the total pixel matrix is
parallel to the slide surface. Here, we further assume that rows and
columns of total pixel matrix are parallel to the borders of the slide,
i.e. the x and y axis of the slide coordinate system.

The row direction (left to right) of the Total Pixel Matrix
is defined by the first three values.
The three values specify how the direction changes from the last pixel
to the first pixel in the row along each of the three axes of the
slide coordinate system (x, y, z), i.e. it express in which direction one
is moving in the slide coordinate system when the COLUMN index changes.
The column direction (top to bottom) of the Total Pixel Matrix
is defined by the second three values.
The three values specify how the direction changes from the last pixel
to the first pixel in the column along each of the three axes of the
slide coordinate system (x, y, z), i.e. it express in which direction one
is moving in the slide coordinate system when the ROW index changes.

@param {object} metadata - Metadata of a DICOM VL Whole Slide Microscopy Image instance
@returns {number} Rotation in radians
@private
Determines whether image needs to be rotated relative to slide coordinate system based on direction cosines . We want to rotate all images such that the X axis of the slide coordinate system is the vertical axis ( ordinate ) of the viewport and the Y axis of the slide coordinate system is the horizontal axis ( abscissa ) of the viewport . Note that this is opposite to the Openlayers coordinate system . There are only planar rotations since the total pixel matrix is parallel to the slide surface . Here we further assume that rows and columns of total pixel matrix are parallel to the borders of the slide i . e . the x and y axis of the slide coordinate system . The row direction ( left to right ) of the Total Pixel Matrix is defined by the first three values . The three values specify how the direction changes from the last pixel to the first pixel in the row along each of the three axes of the slide coordinate system ( x y z ) i . e . it express in which direction one is moving in the slide coordinate system when the COLUMN index changes . The column direction ( top to bottom ) of the Total Pixel Matrix is defined by the second three values . The three values specify how the direction changes from the last pixel to the first pixel in the column along each of the three axes of the slide coordinate system ( x y z ) i . e . it express in which direction one is moving in the slide coordinate system when the ROW index changes . @param { object } metadata - Metadata of a DICOM VL Whole Slide Microscopy Image instance @returns { number } Rotation in radians @private
function _getRotation (metadata) {
  const angle = computeRotation({
    orientation: metadata.ImageOrientationSlide
  })
  const correction = 90 * (Math.PI / 180)
  return angle + correction
}
function _getRotation ( metadata ) { const angle = computeRotation ( { orientation : metadata . ImageOrientationSlide } ) const correction = 90 * ( Math . PI / 180 ) return angle + correction }
Determines whether image needs to be rotated relative to slide
 coordinate system based on direction cosines.
Determines whether image needs to be rotated relative to slide coordinate system based on direction cosines .
// Angle with respect to the reference orientation // We want the slide oriented horizontally with the label on the right side