示例#1
0
        /// <summary>
        /// Allows specification of the slice plane, through point, and extent via two points in patient space
        /// </summary>
        public static VolumeSlicerParams Create(Volume volume, Vector3D sourceOrientationColumnPatient, Vector3D sourceOrientationRowPatient,
                                                Vector3D startPointPatient, Vector3D endPointPatient)
        {
            Vector3D sourceOrientationNormalPatient = sourceOrientationColumnPatient.Cross(sourceOrientationRowPatient);
            Vector3D normalLinePatient     = (endPointPatient - startPointPatient).Normalize();
            Vector3D normalPerpLinePatient = sourceOrientationNormalPatient.Cross(normalLinePatient);

            Vector3D slicePlanePatientX = normalLinePatient;
            Vector3D slicePlanePatientY = sourceOrientationNormalPatient;
            Vector3D slicePlanePatientZ = normalPerpLinePatient;

            Matrix slicePlanePatientOrientation = Math3D.OrientationMatrixFromVectors(slicePlanePatientX, slicePlanePatientY, slicePlanePatientZ);

            Matrix   _resliceAxes           = volume.RotateToVolumeOrientation(slicePlanePatientOrientation);
            Vector3D lineMiddlePointPatient = new Vector3D(
                (startPointPatient.X + endPointPatient.X) / 2,
                (startPointPatient.Y + endPointPatient.Y) / 2,
                (startPointPatient.Z + endPointPatient.Z) / 2);

            VolumeSlicerParams slicerParams = new VolumeSlicerParams(_resliceAxes);

            slicerParams.SliceThroughPointPatient = new Vector3D(lineMiddlePointPatient);
            slicerParams.SliceExtentXMillimeters  = (endPointPatient - startPointPatient).Magnitude;

            return(slicerParams);
        }
示例#2
0
		/// <summary>
		/// Allows specification of the slice plane, through point, and extent via two points in patient space
		/// </summary>
		public static VolumeSlicerParams Create(Volume volume, Vector3D sourceOrientationColumnPatient, Vector3D sourceOrientationRowPatient,
		                                               Vector3D startPointPatient, Vector3D endPointPatient)
		{
			Vector3D sourceOrientationNormalPatient = sourceOrientationColumnPatient.Cross(sourceOrientationRowPatient);
			Vector3D normalLinePatient = (endPointPatient - startPointPatient).Normalize();
			Vector3D normalPerpLinePatient = sourceOrientationNormalPatient.Cross(normalLinePatient);

			Vector3D slicePlanePatientX = normalLinePatient;
			Vector3D slicePlanePatientY = sourceOrientationNormalPatient;
			Vector3D slicePlanePatientZ = normalPerpLinePatient;

			Matrix slicePlanePatientOrientation = Math3D.OrientationMatrixFromVectors(slicePlanePatientX, slicePlanePatientY, slicePlanePatientZ);

			Matrix _resliceAxes = volume.RotateToVolumeOrientation(slicePlanePatientOrientation);
			Vector3D lineMiddlePointPatient = new Vector3D(
				(startPointPatient.X + endPointPatient.X)/2,
				(startPointPatient.Y + endPointPatient.Y)/2,
				(startPointPatient.Z + endPointPatient.Z)/2);

			VolumeSlicerParams slicerParams = new VolumeSlicerParams(_resliceAxes);

			slicerParams.SliceThroughPointPatient = new Vector3D(lineMiddlePointPatient);
			slicerParams.SliceExtentXMillimeters = (endPointPatient - startPointPatient).Magnitude;

			return slicerParams;
		}