Пример #1
0
        public double[] ProjectedPointAtIsocenterPlaneInUCS(double[] pointPCS, double SAD = 1000)
        {
            double[] sourceUCS = new double[3] {
                0.0, -SAD, 0.0
            };
            double[] pointUCS = new double[3] {
                0.0, 0.0, 0.0
            };
            CoordinateTransform3D.PlanningToUnitCoordinate(Isocenter,
                                                           GantryAngle, CollimatorAngle, CouchAngle,
                                                           pointPCS, pointUCS);

            double[] sourceToPointUCS = new double[3] {
                pointUCS[0] - sourceUCS[0], pointUCS[1] - sourceUCS[1], pointUCS[2] - sourceUCS[2]
            };

            if (sourceToPointUCS[1] < Double.Epsilon)
            {
                throw new InvalidOperationException("pointPCS is on or above the source plane");
            }

            double sf = SAD / Math.Abs(sourceToPointUCS[1]);

            double[] sourceToPointAtIcpUCS = new double[3] {
                sf *sourceToPointUCS[0], sf *sourceToPointUCS[1], sf *sourceToPointUCS[2]
            };

            double[] projectedPointAtIcpUCS = new double[3] {
                sourceUCS[0] + sourceToPointAtIcpUCS[0],
                sourceUCS[1] + sourceToPointAtIcpUCS[1],
                sourceUCS[2] + sourceToPointAtIcpUCS[2]
            };

            return(projectedPointAtIcpUCS);
        }
Пример #2
0
        /// <summary>
        /// Transform Planning coordinate to Unit coordinate
        /// </summary>
        /// <param name="planningCoordinate"> Planning coordinate to transform </param>
        /// <param name="unitCoordinate"> Transformed Unit coordinate </param>
        public void PCStoUCS(double[] planningCoordinate, double[] unitCoordinate)
        {
            CoordinateTransform3D.PlanningToUnitCoordinate(Isocenter,
                                                           GantryAngle, CollimatorAngle, CouchAngle,
                                                           planningCoordinate, unitCoordinate);

            return;
        }