src/util/pointProjector.js
/**
 * Projects an image point to a patient point
 * @export @public @method
 * @name imagePointToPatientPoint
 *
 * @param  {Object} imagePoint   The image point.
 * @param  {Object} imagePlane   The image plane used for projection.
 * @returns {Object}              The projected coordinates.
 */
Projects an image point to a patient point
@export @public @method
@name imagePointToPatientPoint

@param  {Object} imagePoint   The image point.
@param  {Object} imagePlane   The image plane used for projection.
@returns {Object}              The projected coordinates.
Projects an image point to a patient point @export @public @method @name imagePointToPatientPoint @param { Object } imagePoint The image point . @param { Object } imagePlane The image plane used for projection . @returns { Object } The projected coordinates .
function imagePointToPatientPoint(imagePoint, imagePlane) {
  const rowCosines = convertToVector3(imagePlane.rowCosines);
  const columnCosines = convertToVector3(imagePlane.columnCosines);
  const imagePositionPatient = convertToVector3(
    imagePlane.imagePositionPatient
  );
  const x = rowCosines.clone().multiplyScalar(imagePoint.x);
  x.multiplyScalar(imagePlane.columnPixelSpacing);
  const y = columnCosines.clone().multiplyScalar(imagePoint.y);
  y.multiplyScalar(imagePlane.rowPixelSpacing);
  const patientPoint = x.add(y);
  patientPoint.add(imagePositionPatient);
  return patientPoint;
}
function imagePointToPatientPoint ( imagePoint , imagePlane ) { const rowCosines = convertToVector3 ( imagePlane . rowCosines ) ; const columnCosines = convertToVector3 ( imagePlane . columnCosines ) ; const imagePositionPatient = convertToVector3 ( imagePlane . imagePositionPatient ) ; const x = rowCosines . clone ( ) . multiplyScalar ( imagePoint . x ) ; x . multiplyScalar ( imagePlane . columnPixelSpacing ) ; const y = columnCosines . clone ( ) . multiplyScalar ( imagePoint . y ) ; y . multiplyScalar ( imagePlane . rowPixelSpacing ) ; const patientPoint = x . add ( y ) ; patientPoint . add ( imagePositionPatient ) ; return patientPoint ; }
Projects an image point to a patient point
 @export @public @method
 @name imagePointToPatientPoint
Projects an image point to a patient point @export @public @method @name imagePointToPatientPoint