Exemple #1
0
        private static string GetImageAnnotationHtml(aim_dotnet.ImageAnnotation imageAnnotation)
        {
            StringBuilder    sb            = new StringBuilder();
            AimHtmlFormatter htmlFormatter = new AimHtmlFormatter();

            Color ctrlColor = Color.FromKnownColor(KnownColor.Control);
            Color fontColor = Color.FromKnownColor(KnownColor.WindowText);

            sb.Append(HtmlDocHeader);
            sb.AppendFormat("<body style=\"background-color: #{0}{1}{2};\" onload=\"setupPaths(['{3}', '{4}'])\">",
                            ctrlColor.R.ToString("X2"), ctrlColor.G.ToString("X2"), ctrlColor.B.ToString("X2"),
                            MinusImagePathName, PlusImagePathName);
            sb.Append("<div id=\"main_content\">");
            sb.AppendFormat("<div><b>Name: {0}</b></div>", imageAnnotation.Name);
            sb.AppendFormat("<div>Number of Markups: {0}</div>", imageAnnotation.GeometricShapeCollection == null ? 0 : imageAnnotation.GeometricShapeCollection.Count(geoShape => geoShape != null));
            if (imageAnnotation.User != null)
            {
                sb.AppendFormat("<div>Created by: {0}</div>", imageAnnotation.User.Name);
            }
            sb.Append(htmlFormatter.GetAnatomicEntitiesHtml(imageAnnotation.AnatomyEntityCollection));
            sb.Append(htmlFormatter.GetImagingObservationHtml(imageAnnotation.ImagingObservationCollection));
            // TODO - append other sections
            sb.Append("</div>");
            sb.Append("</body>");
            sb.Append("</html>");

            return(sb.ToString());
        }
        private static string GetImageAnnotationHtml(aim_dotnet.ImageAnnotation imageAnnotation)
        {
            StringBuilder sb = new StringBuilder();
            AimHtmlFormatter htmlFormatter = new AimHtmlFormatter();

            Color ctrlColor = Color.FromKnownColor(KnownColor.Control);
            Color fontColor = Color.FromKnownColor(KnownColor.WindowText);

            sb.Append(HtmlDocHeader);
            sb.AppendFormat("<body style=\"background-color: #{0}{1}{2};\" onload=\"setupPaths(['{3}', '{4}'])\">",
                ctrlColor.R.ToString("X2"), ctrlColor.G.ToString("X2"), ctrlColor.B.ToString("X2"),
                MinusImagePathName, PlusImagePathName);
            sb.Append("<div id=\"main_content\">");
            sb.AppendFormat("<div><b>Name: {0}</b></div>", imageAnnotation.Name);
            sb.AppendFormat("<div>Number of Markups: {0}</div>", imageAnnotation.GeometricShapeCollection == null ? 0 : imageAnnotation.GeometricShapeCollection.Count(geoShape => geoShape != null));
            if (imageAnnotation.User != null)
                sb.AppendFormat("<div>Created by: {0}</div>", imageAnnotation.User.Name);
            sb.Append(htmlFormatter.GetAnatomicEntitiesHtml(imageAnnotation.AnatomyEntityCollection));
            sb.Append(htmlFormatter.GetImagingObservationHtml(imageAnnotation.ImagingObservationCollection));
            // TODO - append other sections
            sb.Append("</div>");
            sb.Append("</body>");
            sb.Append("</html>");

            return sb.ToString();
        }