コード例 #1
0
        public void SetCanvas(CanvasPage canvas)
        {
            Canvas = canvas;
            if(canvas.DcmObject == null)
            {
                Console.Out.WriteLine("null canvas dicom object");
                return;
            }
            float width = float.Parse((canvas.DcmObject.FindFirst(TagHelper.WINDOW_WIDTH) as DecimalString).UntypedData.ToString());
            float center = float.Parse((canvas.DcmObject.FindFirst(TagHelper.WINDOW_CENTER) as DecimalString).UntypedData.ToString());

            float min = center - width / 2;
            float max = center + width / 2;

            BackSlide.Value = canvas.DcmImage.Properties.WindowAndLevel.Window;
            WindowValue.Content = ((int)(BackSlide.Value)).ToString();
            BackSlide.Minimum = 0;
            BackSlide.Maximum = max - min;
            LvlSlide.Value = canvas.DcmImage.Properties.WindowAndLevel.Level;
            LevelValue.Content = ((int)(LvlSlide.Value)).ToString();
            LvlSlide.Minimum = min;
            LvlSlide.Maximum = max;

            FrameSlide.Maximum = (canvas.DcmObject.FindFirst(TagHelper.NUMBER_OF_FRAMES) as IntegerString).Data;
            FrameSlide.Minimum = 0;
            FrameValue.Content = "0";
        }
コード例 #2
0
 private void DeleteAnnotationButton_Click(object sender, RoutedEventArgs e, CanvasPage page)
 {
     if(AlterSelected)
     {
         page.ImageCanvas.Children.Remove(this);
     }
 }
コード例 #3
0
 public void SubmitUpdateAnnotation(Point point, string text, CanvasPage page, Button button1, Button button2)
 {
     if(text != null && !text.Equals(""))
     {
         this.Content = text;
     }
 }
コード例 #4
0
 public AnnotationWindow(Point point, CanvasPage page, SubmitAnnot submitAnnotation, Button deleteButton, Button editButton)
 {
     InitializeComponent();
     AnnotPoint = point;
     Page = page;
     Submit = submitAnnotation;
     Delete = deleteButton;
     Edit = editButton;
 }
コード例 #5
0
 private void EditAnnotationButton_Click(Object sender, RoutedEventArgs e, CanvasPage page)
 {
     if(AlterSelected)
     {
         Console.Out.WriteLine("In EditAnnotationButton_Click() ");
         string currString = this.Content.ToString(); 
         AnnotationWindow updateAnnotation = new AnnotationWindow(currString, SubmitUpdateAnnotation);
         updateAnnotation.Visibility = System.Windows.Visibility.Visible;
     }
 }
コード例 #6
0
 public void SubmitAnnotation(Point point, string text, CanvasPage page, Button deleteButton, Button editButton)
 {
     AnnotationLabel lbl = new AnnotationLabel(page, deleteButton, editButton);
     lbl.Foreground = System.Windows.Media.Brushes.White;
     lbl.FontSize = 30;
     lbl.Content = text;
     lbl.LblPosition = point;
     Canvas.SetLeft(lbl, point.X);
     Canvas.SetTop(lbl, point.Y);
     page.AddToCanvas(lbl);
 }
コード例 #7
0
 private void DefPulmAnnots(ref List<string> headers, ref List<string> footers, CanvasPage page, VQExam exam, Template temp)
 {
     //Update all VQ headers
     for (int i = 0; i < headers.Count; i++)
     {
         string concat = null;
         switch (headers[i])
         {
             case "Patient: ":
                 concat = exam.PtName;
                 break;
             case "ID: ":
                 concat = exam.PtID.ToString();
                 break;
             case "DOB: ":
                 concat = exam.PtDOB;
                 break;
             case "Technologist: ":
                 concat = exam.TechInitials;
                 break;
             case "Facility: ":
                 concat = DBUtil.DataSet.Facility[0].Name;
                 break;
         }
         headers[i] = headers[i] + concat;
     }
     //Update all VQ footers
     for(int i = 0; i < footers.Count; i++)
     {
         string concat = null;
         switch(footers[i])
         {
             case "Dose: ":
                 //TODO: Change the comparison string to Ventilation so that proper comparison can be done
                 //      against the template when an actual VQ image is finally obtained.
                 if(page.Name.Equals("VENTILATION"))
                 {
                     concat = exam.VentilationDose.ToString() + "mCi 133-Xenon";
                 }
                 else
                 {
                     concat = exam.PerfusionDose.ToString() + "mCi 99mTc-MAA";
                 }
                 break;
             case "Exam: ":
                 concat = page.Name;
                 break;
         }
         footers[i] = footers[i] + concat;
     }
 }
コード例 #8
0
 public AnnotationLabel(CanvasPage page, Button deleteButton, Button editButton) : base()
 {
     Selected = false;
     AlterSelected = false;
     this.Background = Brushes.Transparent;
     this.BorderBrush = Brushes.Transparent;
     this.BorderThickness = new Thickness(10, 10, 10, 10);
     MouseRightButtonDown += (sender, e) => { lbl_MouseDown(page, e); };
     MouseRightButtonUp += (sender, e) => { lbl_MouseUp(page); };
     MouseMove += (sender, e) => { lbl_MouseMove(sender, e); };
     Click += (sender, e) => { lbl_Click(sender, e); };
     deleteButton.Click += (sender, e) => DeleteAnnotationButton_Click(sender, e, page);
     editButton.Click += (sender, e) => EditAnnotationButton_Click(sender, e, page);
 }
コード例 #9
0
 public void DefAnnotations(CanvasPage page, IExam exam, ExamType type, Template temp)
 {
     if (type == ExamType.REVIEW)
         return;
     var headers = temp.GetHeaders(exam.TempID, page.Name);
     var footers = temp.GetFooters(exam.TempID, page.Name);
     if(headers != null && footers != null)
     {
         switch(type)
         {
             case ExamType.PULMONARY:
                 DefPulmAnnots(ref headers, ref footers, page, (exam as VQExam), temp);
                 break;
         }
     }
     SetAnnotations(page, headers, footers);
     //page.SetAnnotations(headers, footers);
 }
コード例 #10
0
        private bool ParsePulmonaryTemplate(ref XmlNodeList pageNodes)
        {
            try
            {
                foreach (XmlNode page in pageNodes)
                {
                    string name = page.Attributes["Name"].Value;
                    bool multiFramed = Convert.ToBoolean(page.Attributes["Multiframed"].Value);
                    bool sequential = Convert.ToBoolean(page.Attributes["Sequential"].Value);
                    XmlNode childNode = page.SelectSingleNode("SplashArray");
                    int columns = Convert.ToInt32(childNode.SelectSingleNode("Columns").FirstChild.Value);
                    int rows = Convert.ToInt32(childNode.SelectSingleNode("Rows").FirstChild.Value);
                    XmlNodeList cellList = childNode.SelectNodes("Cell");

                    Console.Out.WriteLine("Multiframed Value: " + page.Attributes["Multiframed"].Value);
                    //Annotations Element
                    childNode = childNode.NextSibling;

                    //Header Child
                    childNode = childNode.SelectSingleNode("Header");
                    string facility = childNode.Attributes["Facility"].Value;
                    string patient = childNode.Attributes["Patient"].Value;
                    string id = childNode.Attributes["ID"].Value;
                    string dob = childNode.Attributes["DOB"].Value;
                    string technologist = childNode.Attributes["Technologist"].Value;
                    List<string> headers = new List<string>(6);
                    headers.Add(facility);
                    headers.Add(patient);
                    headers.Add(id);
                    headers.Add(dob);
                    headers.Add(technologist);

                    //Footer Child
                    childNode = childNode.NextSibling;
                    string dose = childNode.Attributes["Dose"].Value;
                    string exam = childNode.Attributes["Exam"].Value;
                    List<string> footers = new List<string>(2);
                    footers.Add(dose);
                    footers.Add(exam);

                    CanvasPage pg = new CanvasPage
                    {
                        Name = name,
                        Columns = columns,
                        Rows = rows,
                        Headers = headers,
                        Footers = footers,
                        MultiFramed = multiFramed,
                        Sequential = sequential
                    };

                    Console.Out.WriteLine("Sequential: " + sequential + " Multiframed: " + multiFramed);
                    pg.ArrayAnnotations = new CanvasPage.Cell[pg.Columns, pg.Rows];
                    
                    /*foreach (XmlNode cell in cellList)
                    {
                        string annotation = cell.Attributes["Annotation"].Value;
                        string orientation = cell.Attributes["Orientation"].Value;
                        int column = Convert.ToInt32(cell.SelectSingleNode("Column").FirstChild.Value);
                        int row = Convert.ToInt32(cell.SelectSingleNode("Row").FirstChild.Value);
                        
                        pg.ArrayAnnotations[column, row] = new RadSysNM.Pages.CanvasPage.Cell
                        {
                            Annotation = annotation,
                            Orientation = orientation
                        };
                    }*/

                    TemplateParent.Canvases.Add(pg);
                }
                return true;
            }
            catch (Exception e) { MessageBox.Show(e.ToString()); return false; }
        }
コード例 #11
0
 private void LaunchAnnotationWindow(Point point, CanvasPage page, Button deleteButton, Button editButton)
 {
     AnnotationWindow annotWind = new AnnotationWindow(point, page, SubmitAnnotation, deleteButton, editButton);
     annotWind.Visibility = Visibility.Visible;
 }
コード例 #12
0
 public void AddAnnotation(Point point, CanvasPage page, Button deleteButton, Button editButton)
 {
     LaunchAnnotationWindow(point, page, deleteButton, editButton);
 }
コード例 #13
0
 private void AddHeader(string header, CanvasPage canvas)
 {
     Label lbl = new Label();
     lbl.Foreground = System.Windows.Media.Brushes.White;
     lbl.FontSize = 30;
     lbl.Content = header;
     canvas.HeaderPanel.Children.Add(lbl);
 }
コード例 #14
0
 public void SetAnnotations(CanvasPage canvas, List<string> headers, List<string> footers)
 {
     if (headers != null && footers != null)
     {
         foreach (string header in headers)
         {
             AddHeader(header, canvas);
             AddHeader(Pad, canvas);
         }
         foreach (string footer in footers)
         {
             AddFooter(footer, canvas);
             AddFooter(Pad, canvas);
         }
     }
 }
コード例 #15
0
 private void lbl_MouseDown(CanvasPage page, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (!Selected)
     {
         Selected = true;
         CaptureMouse();
     }
 }
コード例 #16
0
 private void lbl_MouseUp(CanvasPage page)
 {
     if (Selected)
     {
         Selected = false;
         ReleaseMouseCapture();
     }
 }