private IEnumerable <DicomImagePlane> GetPlanesParallelToReferencePlane()
        {
            DicomImagePlane currentReferenceImagePlane = DicomImagePlane.FromImage(this.imageViewerManager.CurrentDicomImageViewControl.CurrentDicomElement.PresentationImage);

            foreach (DicomElement dicomElement in this.imageViewerManager.CurrentDicomImageViewControl.DicomElements)
            {
                DicomImagePlane plane = DicomImagePlane.FromImage(dicomElement.PresentationImage);
                if (plane != null)
                {
                    if (currentReferenceImagePlane.IsInSameFrameOfReference(plane) &&
                        currentReferenceImagePlane.IsParallelTo(plane, _oneDegreeInRadians))
                    {
                        yield return(plane);
                    }
                }
            }
        }
        private static ReferenceLine GetReferenceLine(DicomImagePlane referenceImagePlane, DicomImagePlane targetImagePlane)
        {
            const float parallelTolerance = (float)(Math.PI / 18);

            if (referenceImagePlane.IsParallelTo(targetImagePlane, parallelTolerance))
            {
                return(null);
            }

            Vector3D intersectionPatient1, intersectionPatient2;

            if (!referenceImagePlane.GetIntersectionPoints(targetImagePlane, out intersectionPatient1, out intersectionPatient2))
            {
                return(null);
            }

            Vector3D intersectionImagePlane1 = targetImagePlane.ConvertToImagePlane(intersectionPatient1);
            Vector3D intersectionImagePlane2 = targetImagePlane.ConvertToImagePlane(intersectionPatient2);

            PointF intersectionImage1 = targetImagePlane.ConvertToImage(new PointF(intersectionImagePlane1.X, intersectionImagePlane1.Y));
            PointF intersectionImage2 = targetImagePlane.ConvertToImage(new PointF(intersectionImagePlane2.X, intersectionImagePlane2.Y));

            return(new ReferenceLine(intersectionImage1, intersectionImage2, ""));
        }